def run(path,outpath):
	global output_path;
	output_path = os.path.join(outpath,"cocos2dx_snippet");
	if(os.path.exists(output_path)): shutil.rmtree(output_path,True);
	os.mkdir(output_path)

	apis = helper.getFileList(path,"*/api/*.lua","*/lua_cocos2dx_*.lua");
	for api in apis:
		print(api);
		dealWithFile(api)
	# pass
	
# run("/Users/terrantian/Documents/wukong_workspace/wukong_client/trunk/mk/frameworks",".")

	
# def main():
# 	#remove old snippet
# 	if os.path.isdir(output_path):
# 		shutil.rmtree(output_path)
# 	os.mkdir(output_path)
	
# 	#deal with api file
# 	if not os.path.isdir(api_path):
# 		print "Please change cocos2dx_root and output_path to your path."
# 		return
# 	for file in os.listdir(api_path):
# 		#ignore .DStore and lua_cocos2dx_...
# 		if file[0] != "." and not file.startswith("lua_cocos2dx") :
# 			dealWithFile(api_path + file)

# if __name__ == '__main__':
# 	main()
def saveFileInfo():
    fileInfo = helper.getFileList()
    # fileInfo = test.sampleFileList

    with io.open(config.urlFileName, 'w') as outfile:
        for item in fileInfo:
            outfile.write(unicode(item["filePath"] +"\n"))

    return