import time
import config
-import brdlist
REG_EXPR_HTTPDATE = re.compile("((?:Mon)|(?:Tue)|(?:Wed)|(?:Thu)|(?:Fri)|(?:Sat)|(?:Sun)), (\d{2}) ((?:Jan)|(?:Feb)|(?:Mar)|(?:Apr)|(?:May)|(?:Jun)|(?:Jul)|(?:Aug)|(?:Sep)|(?:Oct)|(?:Nov)|(?:Dec)) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT")
WDAY_DICT = {"Mon":0, "Tue":1, "Wed":2, "Thu":3, "Fri":4, "Sat":5, "Sun":6}
def get_logs_dir_path():
return os.path.join(config.get_config_dir_path(), "logs")
-def get_board_base_url(bbs, board):
- """
- Note: this function uses brdlist.get function, so brdlist.init function
- should have been called before this function is called
- """
- # if parameter is empty, raise ValueError
- if not bbs or not board:
- raise ValueError, "parameter must not be empty"
-
- return "http://" + brdlist.get(bbs, board, "host") + "/" + board + "/"
-
-def get_thread_dat_url(bbs, board, thread):
- """Returns thread dat url"""
-
- # if parameter is empty, raise ValueError
- if not bbs or not board or not thread:
- raise ValueError, "parameter must not be empty"
-
- return get_board_base_url(bbs, board) + "dat/" + thread + ".dat"
-
def get_thread_dat_path(bbs, board, thread):
"""Returns thread dat file path