def copySrcFromproject(): fromPath = ".." floder = "src" # os.system("rm -rf %s"%(os.path.join(toPath, floder))) syncDir(os.path.join(fromPath, floder), os.path.join(toPath, floder)) main_js = os.path.join(toPath, "main.js") if os.path.exists(main_js): os.system('rm %s' % main_js) os.system("cp ../mainjs/main.jsc %s" % os.path.join(toPath, "main.jsc"))
def copyFromAndroidproject(): # fromPath = "../frameworks/runtime-src/proj.android/assets" # copyDirs = ["res", "src"] for item in copyDirs: syncDir(os.path.join(fromPath, item), os.path.join(toPath, item)) #copyList = ["main.jsc","project.json"] copyList = ["main.jsc"] for item in copyList: os.system("cp %s %s" % (os.path.join(fromPath, item), os.path.join(toPath, item)))
def syncCocosEffect(): root_path = "/Users/tanzuoliang/art_resource/天天坦克/特效文件" syncSignalCocosEffect(os.path.join(root_path, "cocos特效"), os.path.join(project_root, "res/cocos_effect")) """ 要做好分语种资源分类处理 Y.英文特效 """ syncSignalCocosEffect( os.path.join(root_path, "Y.英文特效"), os.path.join(project_root, "res/cocos_effect_lang_en")) """ 同步电视资源 """ syncDir(os.path.join(root_path, "电视端/Tank_effect_logo_tv"), os.path.join(project_root, "res/tv/res/cocos_effect"))
def copySrcFromproject(toPath): fromPath = "." floder = "src" # os.system("rm -rf %s"%(os.path.join(toPath, floder))) syncDir(os.path.join(fromPath, floder), os.path.join(toPath, floder)) handleMainjs() main_js = os.path.join(toPath, "main.js") if os.path.exists(main_js): os.system('rm %s' % main_js) os.system("cp mainjs/main.jsc %s" % os.path.join(toPath, "main.jsc")) """ check script """ script_path = "frameworks/cocos2d-x/cocos/scripting/js-bindings/script" script_path_to = "frameworks/runtime-src/proj.android-studio/app/assets/script" if not os.path.exists(script_path_to): copyDir(script_path, script_path_to)
from myutil.utils import getDirsize import os if os.path.exists( '../res-new') and getDirsize('../res') < getDirsize('../res-new'): print "当前res是压缩后的" else: os.system('svn up %s' % toLanguage) for tu in ll: fromDir = os.path.join(fromRoot, tu[0]) toDir = os.path.join(toRoot, tu[2]) os.system("svn up %s" % fromDir) fromDir = os.path.join(fromRoot, tu[1]) syncDir(fromDir, toDir, False) checkSVNStatus(toRoot, [tu[2]]) for tu in lll: fromDir = os.path.join(fromRoot, tu[0]) toDir = os.path.join(toLanguage, "language_img", tu[2], "res", "new_ui") os.system("svn up %s" % fromDir) fromDir = os.path.join(fromRoot, tu[1]) if not os.path.exists(toDir): os.makedir(toDir) syncDir(fromDir, toDir, False) checkSVNStatus(os.path.join(toLanguage, "language_img"), [tu[2]]) """ 英文引导 """
def copyResFromproject(toPath): fromPath = "." floder = "res" # os.system("rm -rf %s"%(os.path.join(toPath, floder))) syncDir(os.path.join(fromPath, floder), os.path.join(toPath, floder))
#!/usr/bin/python import os from myutil.utils import syncDir syncDir("src", "frameworks/runtime-src/proj.android/assets/src") os.system("cp platform.json frameworks/runtime-src/proj.android/assets/platform.json") os.system("cp project.json frameworks/runtime-src/proj.android/assets/project.json") #syncDir("res", "frameworks/runtime-src/proj.android/assets/res")
#!/usr/bin/python #encoding=utf-8 from myutil import utils utils.syncDir('a', '我是谁')
def syncDirs(fromDir, toDir, l): for d in l: syncDir(os.path.join(fromDir, d), os.path.join(toDir, d))