def _getDetailedBoards(): f = open(boardFilePath) data = f.read() dataout = functions.parseStruct(BOARDSstruct,BOARDSorder,256,data) f.close() for item in dataout: if len(item["BM"]) and item["BM"][0] =="\0": item["BM"] = "" return dataout
def _getFileHeaders(id): try: f = open("/home/bbs/bbshome/mail/%s/%s/%s/.DIR"%(id[0].upper(),id[1].upper(),id),"rb") #print boardFolder + boardName+ os.path.sep +".DIR" except: return [] data = f.read() data = functions.parseStruct(DIRstruct,order,256,data) f.close() for thePost in data: endflag = thePost["filename"].find("\0") if endflag != -1: thePost["filename"] = thePost["filename"][0:endflag] return data
def _getFileHeaders(boardName): if boardName == "": return [] try: f = open(boardFolder + boardName +"/.DIR","rb") #print boardFolder + boardName+ os.path.sep +".DIR" except: return [] data = f.read() data = functions.parseStruct(DIRstruct,order,256,data) f.close() for thePost in data: endflag = thePost["filename"].find("\0") if endflag != -1: thePost["filename"] = thePost["filename"][0:endflag] return data