This commit is contained in:
cwx committed 2022-12-21 00:39:10 +08:00
1 parent fd8d056105
commit 9ec2963a61
5 files changed
+80 -13

No files matched your search

+50 -2
View File
@@ -25,7 +25,8 @@ class comicInfo():
str_homePage = None
str_listChapter = None
str_chapter_imgs = None
str_updateAt = None
chapter_node = None
comicName_node = None
dep_node = None
@@ -116,6 +117,14 @@ class comicInfo():
def getHomePage(cls):
return cls.str_homePage
@classmethod
def setUpdateAt(cls, value):
cls.str_updateAt = value
@classmethod
def getUpdateAt(cls):
return cls.str_updateAt
'''
获取网站主页
'''
@@ -310,4 +319,43 @@ class comicInfo():
cls.setComicName(comicName)
dirConfComic = cls.getDirConfComic()
save_path = os.path.join(dirConfComic,fileName)
return save_path
return save_path
@classmethod
def updateComicDate(cls):
data = {}
update_at = cls.str_updateAt
comic_name = cls.str_comicName
update_path = pathStr.base_comic_update
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
if os.path.exists(update_path):
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
data[comic_name] = update_at
with open(update_path,"w") as fs:
fs.write(json.dumps(data))
fs.close()
@classmethod
def isUpdateComic(cls):
is_update = True
data = {}
c_update_at = cls.str_updateAt
comic_name = cls.str_comicName
update_path = pathStr.base_comic_update
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
try:
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
except:
data = {}
comic_update = data.get(comic_name)
if comic_name != None and comic_update == c_update_at:
is_update = False
return is_update
+4 -2
View File
@@ -6,10 +6,12 @@ class pathStr:
base_CBZ = os.path.join(base_comic_out,"CBZ")
base_comic_img = os.path.join(base_comic_out,"outputComic")
base_conf_path = os.path.join(base_comic_out,".conf")
#base_html_data = os.path.join(base_comic_out,"html_"+str(date))
base_html_cache = os.path.join(base_comic_out,"html_cache")
base_html_chapter = os.path.join(base_comic_out,"html_updated")
base_comic_update = os.path.join(base_conf_path,"comic_update")
@classmethod
def base_html_data(cls):
def base_html_week(cls):
date_path = cls.getDatePath()
return os.path.join(cls.base_comic_out,"html_"+str(date_path))