def get_logs_dir_path():
return os.path.join(config.get_config_dir_path(), "logs")
+def get_thread_dat_dir_path(bbs, board):
+ """Returns dir path for saving thread dat file"""
+
+ # if parameter is empty, raise ValueError
+ if not bbs or not board:
+ raise ValueError, "parameter must not be empty"
+
+ return os.path.join(get_board_dir_path(bbs, board), "dat")
+
+def get_thread_idx_dir_path(bbs, board):
+ """Returns dir path for saving thread index file"""
+
+ # if parameter is empty, raise ValueError
+ if not bbs or not board:
+ raise ValueError, "parameter must not be empty"
+
+ return os.path.join(get_board_dir_path(bbs, board), "idx")
+
def get_thread_dat_path(bbs, board, thread):
"""Returns thread dat file path
if not bbs or not board or not thread:
raise ValueError, "parameter must not be empty"
- return os.path.join(get_board_dir_path(bbs, board), thread + ".dat")
+ return os.path.join(get_thread_dat_dir_path(bbs, board), thread + ".dat")
def get_board_subjecttxt_url(bbs, board):
"""Returns subject.txt file url
if not bbs or not board or not thread:
raise ValueError, "parameter must not be empty"
- return os.path.join(get_logs_dir_path(), bbs, board, thread + ".idx")
+ return os.path.join(get_thread_idx_dir_path(bbs, board), thread + ".idx")
def get_board_cache_path(bbs, board):
""" Returns .cache file path of board
if not bbs or not board:
raise ValueError, "parameter must not be empty"
- return os.path.join(get_logs_dir_path(), bbs, board, ".cache")
+ return os.path.join(get_thread_idx_dir_path(bbs, board), ".cache")
def httpdate_to_secs(httpdate):
"""Returns the seconds since the epoch"""