From cd65cbbc28655309238cd55edc92f32239f91cab Mon Sep 17 00:00:00 2001 From: "Y. Ree" Date: Fri, 17 Aug 2018 10:44:26 +0800 Subject: [PATCH] =?UTF-8?q?Fixed=20the=20problem=20that=20the=20file=20nam?= =?UTF-8?q?e=20of=20screen=20snapshot=20cannot=20be=20par=E2=80=A6=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed the problem that the file name of screen snapshot cannot be parsed when it has special characters. * Fix update version. --- lyrebird_ios/ios_helper.py | 2 +- lyrebird_ios/ui.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lyrebird_ios/ios_helper.py b/lyrebird_ios/ios_helper.py index 3987bc5..4e12897 100644 --- a/lyrebird_ios/ios_helper.py +++ b/lyrebird_ios/ios_helper.py @@ -299,7 +299,7 @@ def stop_log(self): self._log_process = None def take_screen_shot(self): - file_name = self.device_name.replace(' ', '_') + file_name = self.model.replace(' ', '_') p = subprocess.run(f'{idevicescreenshot} -u {self.device_id} {tmp_dir}/{file_name}.png', shell=True) if p.returncode == 0: return os.path.abspath(os.path.join(tmp_dir, '%s.png' % file_name)) diff --git a/lyrebird_ios/ui.py b/lyrebird_ios/ui.py index 28881ac..e335e58 100644 --- a/lyrebird_ios/ui.py +++ b/lyrebird_ios/ui.py @@ -97,7 +97,7 @@ def take_screen_shot(self, device_id): 'Please make sure the idevicescreenshot command works correctly') def get_screenshot_image(self, device_id): - return send_from_directory(tmp_dir, '%s.png' % device_service.devices.get(device_id).device_name.replace(' ', '_')) + return send_from_directory(tmp_dir, '%s.png' % device_service.devices.get(device_id).model.replace(' ', '_')) def make_dump_data(self, path): device_data = {} diff --git a/setup.py b/setup.py index 3728ccd..7ad5d25 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='lyrebird-ios', - version='0.1.5', + version='0.1.6', packages=['lyrebird_ios'], url='https://github.com/meituan/lyrebird-ios', author='HBQA',