try:
sys.argv = [unicode(i.decode(sys.stdin.encoding)) for i in sys.argv]
- print()
except (NameError, TypeError):
pass
except UnicodeDecodeError:
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))
write_config()
exit(0)
- if args.viewer_template:
+ if args.viewer_template is not None:
if not args.viewer_template:
args.viewer_template = 'default'
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))
if __name__ == '__main__':
- if sys.version_info < (3, 0, 0):
- logger.error('nhentai now only support Python 3.x')
- exit(1)
-
main()