32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
import os,datetime
|
|
from time import strftime
|
|
class pathStr:
|
|
base_comic_out = "COMICOUT"
|
|
#base_comic_out = os.path.join("/mnt", "bigTComics")
|
|
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_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_week(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 |