PEP8 and working for #57
This commit is contained in:
parent
622529b9ae
commit
11993f121f
1 changed files with 5 additions and 6 deletions
|
|
@ -22,7 +22,6 @@ SAFARI_BASE_HOST = "learning.oreilly.com"
|
||||||
SAFARI_BASE_URL = "https://" + SAFARI_BASE_HOST
|
SAFARI_BASE_URL = "https://" + SAFARI_BASE_HOST
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Display:
|
class Display:
|
||||||
BASE_FORMAT = logging.Formatter(
|
BASE_FORMAT = logging.Formatter(
|
||||||
fmt="[%(asctime)s] %(message)s",
|
fmt="[%(asctime)s] %(message)s",
|
||||||
|
|
@ -229,7 +228,7 @@ class SafariBooks:
|
||||||
"</container>"
|
"</container>"
|
||||||
|
|
||||||
# Format: ID, Title, Authors, Description, Subjects, Publisher, Rights, Date, CoverId, MANIFEST, SPINE, CoverUrl
|
# Format: ID, Title, Authors, Description, Subjects, Publisher, Rights, Date, CoverId, MANIFEST, SPINE, CoverUrl
|
||||||
CONTENT_OPF = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
|
CONTENT_OPF = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" \
|
||||||
"<package xmlns=\"http://www.idpf.org/2007/opf\" unique-identifier=\"bookid\" version=\"2.0\" >\n" \
|
"<package xmlns=\"http://www.idpf.org/2007/opf\" unique-identifier=\"bookid\" version=\"2.0\" >\n" \
|
||||||
"<metadata xmlns:dc=\"http://purl.org/dc/elements/1.1/\" " \
|
"<metadata xmlns:dc=\"http://purl.org/dc/elements/1.1/\" " \
|
||||||
" xmlns:opf=\"http://www.idpf.org/2007/opf\">\n"\
|
" xmlns:opf=\"http://www.idpf.org/2007/opf\">\n"\
|
||||||
|
|
@ -253,7 +252,7 @@ class SafariBooks:
|
||||||
"</package>"
|
"</package>"
|
||||||
|
|
||||||
# Format: ID, Depth, Title, Author, NAVMAP
|
# Format: ID, Depth, Title, Author, NAVMAP
|
||||||
TOC_NCX = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n" \
|
TOC_NCX = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\" ?>\n" \
|
||||||
"<!DOCTYPE ncx PUBLIC \"-//NISO//DTD ncx 2005-1//EN\"" \
|
"<!DOCTYPE ncx PUBLIC \"-//NISO//DTD ncx 2005-1//EN\"" \
|
||||||
" \"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd\">\n" \
|
" \"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd\">\n" \
|
||||||
"<ncx xmlns=\"http://www.daisy.org/z3986/2005/ncx/\" version=\"2005-1\">\n" \
|
"<ncx xmlns=\"http://www.daisy.org/z3986/2005/ncx/\" version=\"2005-1\">\n" \
|
||||||
|
|
@ -1013,11 +1012,11 @@ if __name__ == "__main__":
|
||||||
args_parsed = arguments.parse_args()
|
args_parsed = arguments.parse_args()
|
||||||
|
|
||||||
if args_parsed.cred:
|
if args_parsed.cred:
|
||||||
cred = SafariBooks.parse_cred(args_parsed.cred)
|
parsed_cred = SafariBooks.parse_cred(args_parsed.cred)
|
||||||
if not cred:
|
if not parsed_cred:
|
||||||
arguments.error("invalid credential: %s" % args_parsed.cred)
|
arguments.error("invalid credential: %s" % args_parsed.cred)
|
||||||
|
|
||||||
args_parsed.cred = cred
|
args_parsed.cred = parsed_cred
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if args_parsed.no_cookies:
|
if args_parsed.no_cookies:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue