Beispiel #1
0
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
Beispiel #2
0
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	
Beispiel #3
0
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