feature: search dojinshis

This commit is contained in:
ricterz
2015-05-08 17:27:41 +08:00
parent 2f616e0fc6
commit e91457889e
3 changed files with 21 additions and 10 deletions

View File

@ -16,6 +16,7 @@ def banner():
def cmd_parser():
parser = OptionParser()
parser.add_option('--search', type='string', dest='keyword', action='store', help='keyword searched')
parser.add_option('--tag', type='string', dest='tag', action='store', help='dojinshi tag')
parser.add_option('--download', dest='is_download', action='store_true', help='download dojinshi or not')
parser.add_option('--id', type='int', dest='id', action='store', help='dojinshi id of nhentai')
parser.add_option('--ids', type='str', dest='ids', action='store', help='dojinshi id set, e.g. 1,2,3')
@ -34,13 +35,13 @@ def cmd_parser():
parser.print_help()
raise SystemExit
if args.keyword:
logger.critical(u'并没有做这个功能_(:3」∠)_')
raise SystemExit
if args.id:
args.ids = (args.id, ) if not args.ids else args.ids
if args.tag:
logger.critical(u'并没有做这个功能_(:3」∠)_')
raise SystemExit
if not args.keyword and not args.ids:
parser.print_help()
raise SystemExit

View File

@ -48,7 +48,12 @@ def dojinshi_parser(id):
return dojinshi
def search_parser(data):
def search_parser(keyword):
logger.debug('Searching dojinshis of keyword %s' % keyword)
return []
def tag_parser(tag):
pass