setup.py and add command line support

This commit is contained in:
ricterz 2015-05-10 01:11:57 +08:00
parent 0b9a70d59b
commit 530316cb91
10 changed files with 17 additions and 13 deletions

2
MANIFEST.in Normal file
View File

@ -0,0 +1,2 @@
include README.md
include requirements.txt

View File

@ -1,11 +1,11 @@
#!/usr/bin/env python
#!/usr/bin/env python2.7
#coding: utf-8
from hentai.cmdline import cmd_parser, banner
from hentai.parser import dojinshi_parser, search_parser, print_dojinshi
from hentai.dojinshi import Dojinshi
from hentai.downloader import Downloader
from hentai.logger import logger
from nhentai.cmdline import cmd_parser, banner
from nhentai.parser import dojinshi_parser, search_parser, print_dojinshi
from nhentai.dojinshi import Dojinshi
from nhentai.downloader import Downloader
from nhentai.logger import logger
__version__ = '0.1'

View File

@ -1,6 +1,6 @@
import Queue
from constant import DETAIL_URL, IMAGE_URL
from hentai.logger import logger
from nhentai.logger import logger
class Dojinshi(object):
@ -36,7 +36,7 @@ class Dojinshi(object):
if __name__ == '__main__':
test = Dojinshi(name='test hentai dojinshi', id=1)
test = Dojinshi(name='test nhentai dojinshi', id=1)
print test
test.show()
try:

View File

@ -6,7 +6,7 @@ import threading
import Queue
import requests
from urlparse import urlparse
from hentai.logger import logger
from nhentai.logger import logger
# global timeout

View File

@ -146,7 +146,7 @@ logger.setLevel(logging.DEBUG)
if __name__ == '__main__':
logger.log(15, 'hentai')
logger.log(15, 'nhentai')
logger.info('info')
logger.warn('warn')
logger.debug('debug')

View File

@ -3,7 +3,7 @@ import re
import requests
from bs4 import BeautifulSoup
from constant import DETAIL_URL, SEARCH_URL
from hentai.logger import logger
from nhentai.logger import logger
def dojinshi_parser(id):

View File

@ -14,11 +14,13 @@ setup(
description='nhentai.net dojinshis downloader',
url='https://github.com/RicterZ/nhentai',
include_package_data=True,
zip_safe=False,
install_requires=requirements,
entry_points={
'console_scripts': [
'nhentai = nhentai:main',
'nhentai = nhentai.command:main',
]
}
},
license='MIT',
)