예제 #1
0
파일: board.py 프로젝트: scaret/FirebirdAPI
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
예제 #2
0
파일: mail.py 프로젝트: scaret/FirebirdAPI
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	
예제 #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