fix
This commit is contained in:
parent
7dd1a86335
commit
e65a1cd79d
@ -17,7 +17,7 @@ class htmlUtils:
|
||||
def getPathSaveHtml(cls,url,type=None):
|
||||
rstr = r"[\/\\\:\*\?\"\<\>\|\.]" # '/ \ : * ? " < > |'
|
||||
file_url = re.sub(rstr, "", url)
|
||||
file_path = os.path.join(pathStr.base_html_data,file_url)
|
||||
file_path = os.path.join(pathStr.base_html_data(),file_url)
|
||||
if type == "new":
|
||||
return file_path
|
||||
if os.path.exists(file_path):
|
||||
|
||||
@ -6,7 +6,25 @@ 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))
|
||||
|
||||
date = datetime.datetime.now()
|
||||
date = date.strftime("%Y%m%d")
|
||||
base_html_data = os.path.join(base_comic_out,"html_"+str(date))
|
||||
@classmethod
|
||||
def base_html_data(cls):
|
||||
date_path = cls.getDatePath()
|
||||
return os.path.join(cls.base_comic_out,"html_"+str(date_path))
|
||||
|
||||
@classmethod
|
||||
def getDatePath(cls):
|
||||
date = datetime.datetime.now()
|
||||
year = int(date.strftime("%Y"))
|
||||
month = int(date.strftime("%m"))
|
||||
day = int(date.strftime("%d"))
|
||||
week = cls.get_week_of_month(year, month, day)
|
||||
return f"{year}{month}{week}"
|
||||
|
||||
@classmethod
|
||||
def get_week_of_month(cls, year, month, day):
|
||||
begin = int(datetime.date(year, month, 1).strftime("%W"))
|
||||
end = int(datetime.date(year, month, day).strftime("%W"))
|
||||
week = "{:0>2d}".format(end - begin + 1)
|
||||
return week
|
||||
Loading…
Reference in New Issue
Block a user