コード例 #1
0
def displace(name, target, location):

    # first, ensure that the target exists
    if not os.path.exists(target):
        print error + "  Target %s doesn't exist!"%target
        print "Try one of these:"
        listArtPaths()
        return


    # if it's a link, kill it
    if os.path.islink(location):
        bash("rm", location)

    # if a folder, move it out the way
    if os.path.exists(location):

        # create __displaced if not done so yet
        displaced = os.path.join(app_path, displacementFolder)
        if not os.path.exists(displaced):
            bash("mkdir", displaced)

        # move folder into displaced folder with datetime 
        displaced = os.path.join(app_path, displacementFolder, "%s-%s"%(name, now()))
        print warn + "  Moving %s folder to %s"%(location, displaced)
        bash("mv", location, displaced)

    # create the link
    bash("ln -sf", target, location) 
    bash("ls -al", location)
コード例 #2
0
def link(version):
    print "Linking %s version assets"%version

    # art
    versionFolder = "24bit"
    if version != "master":
        versionFolder = os.path.join("8bit", version)
    artLink = os.path.join(assets_path, "art-funenglish", versionFolder)
    artLocation = os.path.join(app_path, "art")
    displace("art", artLink, artLocation)

    # audio

    # ensure destination root audio folder is present
    audio = os.path.join(app_path, "audio")
    if not os.path.exists(audio):
        os.chdir(app_path)
        bash("mkdir", audio)

    audioLink = os.path.join(assets_path, "audio-funenglish")
    audioLocation = os.path.join(app_path, "audio", "english")
    displace("english", audioLink, audioLocation)

    # audio
    audioLink = os.path.join(assets_path, "audio-funspanish")
    audioLocation = os.path.join(app_path, "audio", "spanish")
    displace("spanish", audioLink, audioLocation)

    # audio
    audioLink = os.path.join(assets_path, "audio-fungerman")
    audioLocation = os.path.join(app_path, "audio", "german")
    displace("german", audioLink, audioLocation)
    
    # audio
    audioLink = os.path.join(assets_path, "audio-funchinese")
    audioLocation = os.path.join(app_path, "audio", "chinese")
    displace("chinese", audioLink, audioLocation)
    # audio

    audioLink = os.path.join(assets_path, "audio-funfrench")
    audioLocation = os.path.join(app_path, "audio", "french")
    displace("french", audioLink, audioLocation)


    audioLink = os.path.join(assets_path, "audio-funsfx")
    audioLocation = os.path.join(app_path, "audio", "sfx")
    displace("sfx", audioLink, audioLocation)

    audioLink = os.path.join(assets_path, "audio-funmusic")
    audioLocation = os.path.join(app_path, "audio", "music")
    displace("music", audioLink, audioLocation)
コード例 #3
0
ファイル: repoTools.py プロジェクト: solares/funbox2
def checkoutRepo(repo, protocol="ssh"):

    path = os.path.join(repo["base"], repo["path"])
    path = os.path.normpath(path)

    ver = repo["ver"]

    revision = repo["revision"]

    print "%s Checking out  %s" % (tick, revision)
    if ver == "hg":
        bash("hg -R", path, "update", revision)
    else:
        bash("git -C", path, "checkout", revision)
コード例 #4
0
ファイル: repoTools.py プロジェクト: solares/funbox2
def fetchRepo(repo, protocol="ssh"):
    path = os.path.join(repo["base"], repo["path"])
    path = os.path.normpath(path)

    f, ver = ensureVersionFolder(path)

    if ver:
        print "%s Found %s repo at %s" % (tick, ver, path)
        if ver == "hg":
            bash("hg -R", path, "pull")
        else:
            bash("git -C", path, "fetch")

    else:
        name = repo["name"]
        ver = repo["ver"]
        # enter the folder and clone the repo
        url = "ssh://[email protected]/solares/%s" % name
        if protocol == "https":
            url = "https://bitbucket.org/solares/%s" % name
        print "%s Cloning %s" % (tick, url)
        bash(ver, "clone", url, path)
コード例 #5
0
def crushAudio(platform): # todo add language
    # print "Crushing %s audio for %s"%(language, platform)
    print "Crushing audio for %s"%platform

    script_path = os.path.join(assets_path, "audio-funenglish")
    os.chdir(script_path)
    command = "./create_%s_audio.sh"%platform
    bash(command)

    # script_path = os.path.join(assets_path, "audio-fungerman")
    # os.chdir(script_path)
    # command = "./create_%s_audio.sh"%platform
    # bash(command)

    script_path = os.path.join(assets_path, "audio-funsfx")
    os.chdir(script_path)
    command = "./create_%s_sfx_audio.sh"%platform
    bash(command)

    script_path = os.path.join(assets_path, "audio-funmusic")
    os.chdir(script_path)
    command = "./create_%s_music_audio.sh"%platform
    bash(command)
コード例 #6
0
def listArtPaths():
    bash("ls", os.path.join(assets_path, "art-funenglish", "8bit"))
    return
コード例 #7
0
def crushArt(version):
    print "Crushing art to %s"%version
    # TODO move to INI
    art_script_path = "assets/art-funenglish/scripts"
    os.chdir(art_script_path)
    bash("./build.sh", version)
コード例 #8
0
ファイル: iniTools.py プロジェクト: solares/funbox2
def addFolderToPath(cwd):
    bash("export PATH=$PATH:%s" % cwd)
コード例 #9
0
ファイル: buildTools.py プロジェクト: solares/funbox2
def build(args):
    script_path = os.path.join(path_to_app, "scripts", "build")
    os.chdir(script_path)
    args.insert(0, "python build.py")
    bash(*args)
コード例 #10
0
ファイル: buildTools.py プロジェクト: solares/funbox2
def status():
    # first show branch and commit of the principal app repo
    bash("git", "-C", path_to_app, "status")
コード例 #11
0
ファイル: skinTools.py プロジェクト: solares/funbox2
def link(version):
    print "Linking %s version assets" % version
    dest_path = os.path.realpath(app_path)
    os.chdir(skins_path)
    bash("./link.sh", version, dest_path)
コード例 #12
0
ファイル: skinTools.py プロジェクト: solares/funbox2
def crush(product, version):
    print "Crushing %s skin version %s" % (product, version)
    # change to skin folder
    # print (os.getcwd())
    os.chdir(skins_path)
    bash("./build.sh", product, version)
コード例 #13
0
ファイル: repoTools.py プロジェクト: solares/funbox2
def runApp():
    bash(coronaPath, "apps/funenglish")