-
Notifications
You must be signed in to change notification settings - Fork 128
Fix wizzard apkm/zip split packages. #1387
base: async
Are you sure you want to change the base?
Conversation
|
Hey @JabLuszko , |
True, totally forgot I renamed my testing .apkm to .zip. |
| return await self._json_response(data=data[apk_type]) | ||
|
|
||
| def allowed_file(self, filename): | ||
| ALLOWED_EXTENSIONS = set(['apk', 'apkm', 'zip']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is equivalent to ALLOWED_EXTENSIONS = {'apk', 'apkm', 'zip'} which is more efficient as it doesnt create a list then convert it to a set. I dont think it matters in this context though.
This should be a global variable thats initialized once and referenced instead of initialized on every call.
| @@ -537,12 +538,13 @@ def normalize_package(self) -> NoReturn: | |||
| apk = apkutils.APK().from_io(bytes_of_apk).parse_resource() | |||
| manifest = apk.get_manifest() | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like manifest is no longer used. Should be good to remove the line.
| elif not file.filename: | ||
| await self._add_notice_message('No file selected for uploading') | ||
| raise web.HTTPFound(self._url_for("upload")) | ||
| elif not allowed_file(file.filename): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is allowed_file utilized anywhere else? If not, the code should be removed to have a cleaner code base.
No description provided.