Open
Conversation
Comment on lines
-3
to
+5
| class Config(object): | ||
|
|
||
|
|
||
| class Config((object)): |
Author
There was a problem hiding this comment.
Lines 3-16 refactored with the following changes:
- Replace list(), dict() or set() with comprehension (
collection-builtin-to-comprehension)
| try: | ||
| t = SESSION.query(Thumbnail).get(id) | ||
| return t | ||
| return SESSION.query(Thumbnail).get(id) |
Author
There was a problem hiding this comment.
Function thumb refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Comment on lines
-145
to
+151
| if metadata is not None: | ||
| if metadata.has("duration"): | ||
| duration = metadata.get('duration').seconds | ||
| if metadata is not None and metadata.has("duration"): | ||
| duration = metadata.get('duration').seconds | ||
| if duration > min_duration: | ||
| images = [] | ||
| ttl_step = duration // no_of_photos | ||
| current_ttl = ttl_step | ||
| for looper in range(0, no_of_photos): | ||
| for _ in range(no_of_photos): |
Author
There was a problem hiding this comment.
Function generate_screen_shots refactored with the following changes:
- Merge nested if conditions (
merge-nested-ifs) - Replace range(0, x) with range(x) (
remove-zero-from-range) - Replace unused for index with underscore (
for-index-underscore)
| r = requests.get(url, allow_redirects=True, stream=True) | ||
| total_size = int(r.headers.get("content-length", 0)) | ||
| return total_size | ||
| return int(r.headers.get("content-length", 0)) |
Author
There was a problem hiding this comment.
Function DetectFileSize refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Comment on lines
-34
to
+49
| if client is not None: | ||
| if ((total_size // downloaded_size) % 5) == 0: | ||
| time.sleep(0.3) | ||
| try: | ||
| client.edit_message_text( | ||
| chat_id, | ||
| message_id, | ||
| text="{}: {} of {}".format( | ||
| ud_type, | ||
| humanbytes(downloaded_size), | ||
| humanbytes(total_size) | ||
| ) | ||
| if ( | ||
| client is not None | ||
| and ((total_size // downloaded_size) % 5) == 0 | ||
| ): | ||
| time.sleep(0.3) | ||
| try: | ||
| client.edit_message_text( | ||
| chat_id, | ||
| message_id, | ||
| text="{}: {} of {}".format( | ||
| ud_type, | ||
| humanbytes(downloaded_size), | ||
| humanbytes(total_size) | ||
| ) | ||
| except: | ||
| pass | ||
| ) | ||
| except: | ||
| pass |
Author
There was a problem hiding this comment.
Function DownLoadFile refactored with the following changes:
- Merge nested if conditions (
merge-nested-ifs)
| ]) | ||
| ) | ||
| return | ||
| return |
Author
There was a problem hiding this comment.
Function convert_to_video refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp)
This removes the following comments ( why? ):
# chat_id=update.chat.id,
# ref: message from @Mo_Tech_Group
# get the correct width, height, and duration for videos greater than 10MB
# text=Translation.UPLOAD_START,
# await bot.edit_message_text(
# don't care about the extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch
masterrefactored 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
masterbranch, then run:Help us improve this pull request!