From 36946111dbf7f0888ca91dae82efefb6062629ac Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Sun, 17 Jan 2021 11:42:06 +0800 Subject: [PATCH 1/3] fix #198 add notice --- nhentai/cmdline.py | 1 - nhentai/command.py | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nhentai/cmdline.py b/nhentai/cmdline.py index ffc8a3e..fb81d45 100644 --- a/nhentai/cmdline.py +++ b/nhentai/cmdline.py @@ -120,7 +120,6 @@ def cmd_parser(): try: sys.argv = [unicode(i.decode(sys.stdin.encoding)) for i in sys.argv] - print() except (NameError, TypeError): pass except UnicodeDecodeError: diff --git a/nhentai/command.py b/nhentai/command.py index cbc50ed..8b05406 100644 --- a/nhentai/command.py +++ b/nhentai/command.py @@ -19,6 +19,11 @@ from nhentai.utils import generate_html, generate_cbz, generate_main_html, gener def main(): banner() + + if sys.version_info < (3, 0, 0): + logger.error('nhentai now only support Python 3.x') + exit(1) + options = cmd_parser() logger.info('Using mirror: {0}'.format(BASE_URL)) @@ -114,8 +119,4 @@ signal.signal(signal.SIGINT, signal_handler) if __name__ == '__main__': - if sys.version_info < (3, 0, 0): - logger.error('nhentai now only support Python 3.x') - exit(1) - main() From bdc9fa113e9fb5fabbb47837cc033763edd6321a Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Sun, 17 Jan 2021 11:50:22 +0800 Subject: [PATCH 2/3] fix #197 set proxy to null --- nhentai/cmdline.py | 4 ++-- nhentai/logger.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/nhentai/cmdline.py b/nhentai/cmdline.py index fb81d45..69a38f3 100644 --- a/nhentai/cmdline.py +++ b/nhentai/cmdline.py @@ -156,7 +156,7 @@ def cmd_parser(): exit(0) # TODO: search without language - if args.proxy: + if args.proxy is not None: proxy_url = urlparse(args.proxy) if not args.proxy == '' and proxy_url.scheme not in ('http', 'https'): logger.error('Invalid protocol \'{0}\' of proxy, ignored'.format(proxy_url.scheme)) @@ -170,7 +170,7 @@ def cmd_parser(): write_config() exit(0) - if args.viewer_template: + if args.viewer_template is not None: if not args.viewer_template: args.viewer_template = 'default' diff --git a/nhentai/logger.py b/nhentai/logger.py index 8aa46b8..01b4929 100644 --- a/nhentai/logger.py +++ b/nhentai/logger.py @@ -1,7 +1,6 @@ # # Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. # -from __future__ import print_function, unicode_literals import logging import re import platform From 9513141ccf058f301aa103417a46e08df69b396b Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Sun, 17 Jan 2021 11:51:22 +0800 Subject: [PATCH 3/3] 0.4.12 --- nhentai/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nhentai/__init__.py b/nhentai/__init__.py index 171ebc5..bcef93d 100644 --- a/nhentai/__init__.py +++ b/nhentai/__init__.py @@ -1,3 +1,3 @@ -__version__ = '0.4.11' +__version__ = '0.4.12' __author__ = 'RicterZ' __email__ = 'ricterzheng@gmail.com'