Пример #1
0
	def run(self):
		
		if getDirsize(self.resPath) < getDirsize(self.newPath):
			print "has pack res"
			repalceDirName(self.resPath,self.newPath)
			return
		
		for item in self.walkFiles(self.resPath):
			newItem = item.replace(self.resPath, self.newPath,1)
			if os.path.exists(newItem) and os.path.getmtime(item) <= os.path.getmtime(newItem):
				continue
			newDir = os.path.dirname(newItem)
			extName = os.path.splitext(newItem)[1]
			if extName in [".DS_Store"]:
				continue
			if not os.path.exists(newDir):
				os.makedirs(newDir)
				
			self.copyfile(item,newItem,extName in self.blankList)
			if extName in self.zipList:
				os.system(self.pngquant + " --speed=1 --ext .png --skip-if-larger --force 256 " + newItem)
				print "压缩: ", newItem
			if extName in self.hashList:
				self.encodeDataAndSave(newItem)
				print "加密: ", newItem
		self.remove_unuse()			
		repalceDirName(self.resPath,self.newPath)
Пример #2
0
def syncRes():
    res = os.path.join(project_path, "res")
    res_new = os.path.join(project_path, "res-new")
    if os.path.exists(res_new):
        if getDirsize(res) < getDirsize(res_new):
            repalceDirName(res, res_new)
            print "change dir %s form %s" % (res, res_new)

    syncAI()
    syncEffect()
    syncMovieClip()
    syncSound()
    syncSoundEn()
    syncBackground()
    syncElement()
    syncPropSkillIcon()
    syncSkillIcon()
    syncTankIcon()
    syncTankHeadIcon()
    syncEditor()
    syncCocosEffect()
    syncPveMap()

    os.system('svn up %s' % res)
    checkSVNStatus(project_path, ["res"])
    os.system('svn ci %s -m "同步资源"' % res)
Пример #3
0
def handr_for_ios():
	cmd = input("1:readyForIOS 2:backToNormal\n")
	if cmd == 1:
		__decodeJS__()
		repalceDirName("../res","../res-new")
		
		os.system("cp ../main.js ../mainjs/main.js")
		os.system('cocos jscompile -s ../mainjs  -d ../mainjs')
		
	elif cmd == 2:
		backToJS()
		repalceDirName("../res","../res-new")
Пример #4
0
def syncRes():
    res = os.path.join(project_path, "res")
    res_new = os.path.join(project_path, "res-new")
    if os.path.exists(res_new):
        if getDirsize(res) < getDirsize(res_new):
            repalceDirName(res, res_new)
            print "change dir %s form %s" % (res, res_new)

    syncAI()
    syncEffect()
    syncMovieClip()
    syncSound()
    syncBackground()
    syncElement()
    syncPropSkillIcon()
    syncSkillIcon()
    syncTankIcon()
    syncTankHeadIcon()
    syncEditor()
    syncCocosEffect()
    syncPveMap()
Пример #5
0
def __decodeJS__(DIR="../src"):
	if not os.path.exists(os.path.join(DIR, "app.jsc")):
		command = 'cocos jscompile -s' + DIR + ' -d ' + DIR + '_new'
		os.system(command)
		repalceDirName(DIR,DIR + '_new')
Пример #6
0
def backToJS(DIR="../src"):
	if os.path.exists(os.path.join(DIR, "app.jsc")):
		repalceDirName(DIR,DIR + '_new')
		os.system("rm -rf %s"%(DIR + "_new"))	
Пример #7
0
	def resBackToNormal(self):
		if os.path.exists(self.newPath) and getDirsize(self.resPath) < getDirsize(self.newPath):
			repalceDirName(self.resPath,self.newPath)
			print "back successfully"
Пример #8
0
def compilejs(f, t):
    os.system("cocos jscompile -s %s -d %s" % (f, t))
    repalceDirName(f, t)