30 lines
1.1 KiB
Python
30 lines
1.1 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_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 |