Skip to content
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

Fix #744 #746

Merged
merged 1 commit into from
Jul 25, 2020
Merged

Fix #744 #746

merged 1 commit into from
Jul 25, 2020

Conversation

bluerthanever
Copy link
Contributor

Ideally this would do.

  1. Inside menu_fanbox_download_by_post_id, move post = __br__.fanboxGetPostById(post_id) to inside the following try... except..., for which added logic for KeyboardInterrupt (?)
  2. Inside processFanboxArtistById
  • set_console_title is called before artist = __br__.fanboxGetArtistById(id), which is now wrapped with try... except... in case of error.
  • changed print(pex) to PixivHelper.print_and_log("error", "Error getting FANBOX posts of artist: {0} ==> {1}".format(artist, pex.message))
  • in loop for each post, processFanboxPost(post, artist) is now wrapped with try... except..., which will catch and process KeyboardInterrupt
  • a=a+b is changed to a+=b
  1. Inside processFanboxPost, in case KeyboardInterrupt is triggered during download_image, added logic to check the return result, and raise KeyboardInterrupt if it is equivalent to PixivConstant.PIXIVUTIL_ABORTED

1. Inside `menu_fanbox_download_by_post_id`, move `post = __br__.fanboxGetPostById(post_id)` to inside the following `try... except...`, for which added logic for `KeyboardInterrupt`
2. Inside `processFanboxArtistById`
- `set_console_title` is called before `artist = __br__.fanboxGetArtistById(id)`, which is now wrapped with `try... except...` in case of error.
- changed `print(pex)` to `PixivHelper.print_and_log("error", "Error getting FANBOX posts of artist: {0} ==> {1}".format(artist, pex.message))`
- in loop for each post, `processFanboxPost(post, artist)` is now wrapped with `try... except...`, which will catch and process `KeyboardInterrupt`
- a=a+b is changed to a+=b
3. Inside `processFanboxPost`, in case `KeyboardInterrupt` is triggered during `download_image`, added logic to check the return result, and raise `KeyboardInterrupt` if it is equivalent to `PixivConstant.PIXIVUTIL_ABORTED`
@bluerthanever
Copy link
Contributor Author

I think I should be using the colorama as well, also maybe it's time to move FANBOX related logic into handlers, but I am too lazy.
XD

@Nandaka Nandaka merged commit 9b757ff into Nandaka:master Jul 25, 2020
@Nandaka
Copy link
Owner

Nandaka commented Jul 25, 2020

refactor out the process fanbox in commit da02c18

@bluerthanever bluerthanever deleted the patch-1 branch July 25, 2020 02:49
@bluerthanever
Copy link
Contributor Author

Wow. That was fast. Thank you for your work.

byjtje pushed a commit to byjtje/PixivUtil2 that referenced this pull request Oct 30, 2020
1. Inside `menu_fanbox_download_by_post_id`, move `post = __br__.fanboxGetPostById(post_id)` to inside the following `try... except...`, for which added logic for `KeyboardInterrupt`
2. Inside `processFanboxArtistById`
- `set_console_title` is called before `artist = __br__.fanboxGetArtistById(id)`, which is now wrapped with `try... except...` in case of error.
- changed `print(pex)` to `PixivHelper.print_and_log("error", "Error getting FANBOX posts of artist: {0} ==> {1}".format(artist, pex.message))`
- in loop for each post, `processFanboxPost(post, artist)` is now wrapped with `try... except...`, which will catch and process `KeyboardInterrupt`
- a=a+b is changed to a+=b
3. Inside `processFanboxPost`, in case `KeyboardInterrupt` is triggered during `download_image`, added logic to check the return result, and raise `KeyboardInterrupt` if it is equivalent to `PixivConstant.PIXIVUTIL_ABORTED`
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.

None yet

2 participants