kindle manager
This commit is contained in:
7
kman.py
7
kman.py
@@ -64,6 +64,7 @@ CLIPPATH = './tclip.txt'
|
||||
OUTPREF = './clip'
|
||||
DEBUG = 1 # 0 - INFO; 1 - DEBUG
|
||||
LOG2FILE = 1 # 0 - to stdio; 1 - to file
|
||||
LOGFILE = 'log'
|
||||
DELIMITER= '|'
|
||||
|
||||
# log info
|
||||
@@ -73,7 +74,7 @@ logger = logging.getLogger()
|
||||
formatter = logging.Formatter('')
|
||||
|
||||
if LOG2FILE:
|
||||
handler = logging.FileHandler("log")
|
||||
handler = logging.FileHandler(LOGFILE)
|
||||
handler.setFormatter(formatter)
|
||||
logger.addHandler(handler)
|
||||
else:
|
||||
@@ -110,7 +111,7 @@ def parse_section(s,i):
|
||||
"""parse section
|
||||
|
||||
Args:
|
||||
s: section dict
|
||||
s: section line list
|
||||
i: section index
|
||||
|
||||
Returns:
|
||||
@@ -118,7 +119,7 @@ def parse_section(s,i):
|
||||
d = { 'bookname':bookname,
|
||||
bookname: {
|
||||
'author':author
|
||||
'section0':{
|
||||
'0':{
|
||||
'type':'HL',
|
||||
'position':'123',
|
||||
'day':'2020年5月26日',
|
||||
|
||||
Reference in New Issue
Block a user