Skip to content

Sourcery refactored master branch #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented May 11, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from MediaPreneur May 11, 2022 09:47
temp = []
for key in self.cmdList:
temp.append((self.cmdList[key]['order'], key))
temp = [(self.cmdList[key]['order'], key) for key in self.cmdList]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function device.sortCommands refactored with the following changes:

Comment on lines -66 to +73
d = {}
d['UDID'] = self.UDID
if self.customName:
d['name'] = self.customName
else:
d['name'] = self.name
d['ip'] = self.IP
d['owner'] = self.owner
d['location'] = self.location
d['geo'] = self.GEO
d['status'] = ['success', 'warning', 'danger'][self.status]
d = {
'UDID': self.UDID,
'name': self.customName or self.name,
'ip': self.IP,
'owner': self.owner,
'location': self.location,
'geo': self.GEO,
'status': ['success', 'warning', 'danger'][self.status],
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function device.populate refactored with the following changes:


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function device.checkTimeout refactored with the following changes:

MY_ADDR = s.getsockname()[0] + ":8080"
MY_ADDR = f"{s.getsockname()[0]}:8080"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 53-89 refactored with the following changes:

drop_list = []
for key in sorted(mdm_commands.iterkeys()):
drop_list.append([key, key])
drop_list = [[key, key] for key in sorted(mdm_commands.iterkeys())]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_commands.POST refactored with the following changes:

Comment on lines -585 to +583
problem_detect += ') Jailbreak detected for '
problem_detect += ') Jailbreak detected for '
problem_detect += web.ctx.ip

problems.insert(0, problem_detect)
out = "\nproblems = %s" % problems
fd = open('problems.py', 'w')
fd.write(out)
fd.close()
with open('problems.py', 'w') as fd:
fd.write(out)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function do_problem.GET refactored with the following changes:

Comment on lines -597 to +592
if 'CA.crt' in os.listdir('.'):
web.header('Content-Type', 'application/octet-stream;charset=utf-8')
web.header('Content-Disposition', 'attachment;filename="CA.crt"')
return open('CA.crt', "rb").read()
else:
if 'CA.crt' not in os.listdir('.'):
raise web.notfound()
web.header('Content-Type', 'application/octet-stream;charset=utf-8')
web.header('Content-Disposition', 'attachment;filename="CA.crt"')
return open('CA.crt', "rb").read()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function mdm_ca.GET refactored with the following changes:

Comment on lines -620 to +613
if 'Manifest.plist' in os.listdir('.'):
web.header('Content-Type', 'text/xml;charset=utf-8')
return open('Manifest.plist', "rb").read()
else:
if 'Manifest.plist' not in os.listdir('.'):
raise web.notfound()
web.header('Content-Type', 'text/xml;charset=utf-8')
return open('Manifest.plist', "rb").read()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function app_manifest.GET refactored with the following changes:

Comment on lines -630 to +623
if 'MyApp.ipa' in os.listdir('.'):
web.header('Content-Type', 'application/octet-stream;charset=utf-8')
web.header('Content-Disposition', 'attachment;filename="MyApp.ipa"')
return open('MyApp.ipa', "rb").read()
else:
if 'MyApp.ipa' not in os.listdir('.'):
return web.ok
web.header('Content-Type', 'application/octet-stream;charset=utf-8')
web.header('Content-Disposition', 'attachment;filename="MyApp.ipa"')
return open('MyApp.ipa', "rb").read()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function app_ipa.GET refactored with the following changes:

Comment on lines -639 to +629
fd = open(LOGFILE, "a")
fd.write(datetime.now().ctime())
fd.write(" %s\n" % repr(out))
fd.close()
with open(LOGFILE, "a") as fd:
fd.write(datetime.now().ctime())
fd.write(" %s\n" % repr(out))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function log_data refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants