Merge pull request #650 from jdouliez/master

fix(#649) : Fix Wrong filename on RDP screenshot issue
main
mpgn 2022-10-13 14:58:14 +02:00 committed by GitHub
commit fcbd406773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -202,9 +202,9 @@ class rdp(connection):
if self.conn is not None and self.conn.desktop_buffer_has_data is True:
buffer = self.conn.get_desktop_buffer(VIDEO_FORMAT.PIL)
filename = os.path.expanduser('~/.cme/screenshots/{}_{}_{}'.format(self.hostname, self.host, datetime.now().strftime("%Y-%m-%d_%H%M%S")))
filename = os.path.expanduser('~/.cme/screenshots/{}_{}_{}.png'.format(self.hostname, self.host, datetime.now().strftime("%Y-%m-%d_%H%M%S")))
buffer.save(filename,'png')
self.logger.highlight("Screenshot saved {}".format(filename + ".png"))
self.logger.highlight("Screenshot saved {}".format(filename))
def screenshot(self):
asyncio.run(self.screen())