Skip to content

Commit

Permalink
Bugfix/bugit get info error (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
yumiguan authored Oct 16, 2018
1 parent 2971ffb commit 0b84bb1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lyrebird_ios/device_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def publish_devices_info_event(self, online_devices):

@staticmethod
def get_default_app_name():
plugin_conf = lyrebird.context.application.conf.get('plugin.ios')
if not plugin_conf:
return ''
return plugin_conf.get('default_bundle_id')
plugin_conf = lyrebird.context.application.conf.get('plugin.ios', {})
default_bundle_id = plugin_conf.get('bundle_id', '')
return default_bundle_id
8 changes: 6 additions & 2 deletions lyrebird_ios/ios_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def app(self, bundle_id):
for app in self.apps:
if bundle_id in app.get('CFBundleIdentifier'):
return app
_log.debug(f'{bundle_id} is not found in this device!')
return {}

def get_app_list(self):
app_list = []
Expand Down Expand Up @@ -276,11 +278,13 @@ def stop_log(self):

def take_screen_shot(self):
file_name = self.model.replace(' ', '_')
p = subprocess.run(f'{idevicescreenshot} -u {self.device_id} {tmp_dir}/{file_name}.png', shell=True)
p = subprocess.run(f'{idevicescreenshot} -u {self.device_id} {tmp_dir}/{file_name}.png', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err_str = p.stdout.decode()
if p.returncode == 0:
return os.path.abspath(os.path.join(tmp_dir, '%s.png' % file_name))
else:
return False
_log.error(f'{err_str}')
return ''

def to_dict(self):
device_info = {k: self.__dict__[k] for k in self.__dict__ if not k.startswith('_')}
Expand Down
3 changes: 3 additions & 0 deletions lyrebird_ios/static/vue-select.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lyrebird_ios/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h4 class="modal-title"><i class="fa fa-edit"></i>Detail</h4>

<script src="/ui/plugin/iOS/static/vue.js"></script>
<script src="/ui/plugin/iOS/static/vue-resource.js"></script>
<script src="https://unpkg.com/vue-select@latest"></script>
<script src="/ui/plugin/iOS/static/vue-select.js"></script>
<script src="/ui/plugin/iOS/static/vue-simple-spinner.js"></script>

<script>
Expand Down

0 comments on commit 0b84bb1

Please sign in to comment.