コード例 #1
0
def proccessAppAssets(app_name, json):
    """
    Processes the app design assets for a given platform.

    :param json:
        JSON object of app assets to process

    """

    payload = json['payload']
    app_title = payload['app_title']

    assets = payload['assets']
    platform_assets = assets[vams._DEFAULT_PLATFORM]

    current_cnt = 0

    global _WORKING_DIRECTORY

    if vams._DEFAULT_PLATFORM == vams._PLATFORM_ANDROID:
        _WORKING_DIRECTORY = '%s/%s' % (vams._DEFAULT_CONFIG_DIRECTORY,
                                        app_name)

    if not os.path.exists(_WORKING_DIRECTORY):
        os.makedirs(_WORKING_DIRECTORY)

    if _CONSOLE_OUTPUT:
        print '\nUsing Directory: %s' % _WORKING_DIRECTORY
        print u'\nDownloading the Most Recent Art Assets for %s...' % app_title

    for asset in platform_assets:

        if not platform_assets[asset] == None:
            img_url = platform_assets[asset]
            asset_name = asset.replace('_', '-')
            new_file = '%s/%s.png' % (_WORKING_DIRECTORY, asset_name)

            if _CONSOLE_OUTPUT:
                print '%s (%s)' % (asset_name, platform_assets[asset])

            vams.assetFetcher(img_url, new_file)

            current_cnt = current_cnt + 1

    if _CONSOLE_OUTPUT:
        print '\n%s images downloaded' % current_cnt
        print ''

    # Now set the app config data
    setAppConfig(app_name, json)
コード例 #2
0
def downloadProvisioningProfiles(json):
    """
    Downloads the Staging Provisioning Profile from VAMS and writes it to a local location.

    :param json:
        The json object containing the provisioning profile assets
    """

    staging_proifle_url = json['staging']
    if staging_proifle_url:
        if _CONSOLE_OUTPUT:
            print 'Downloading Staging Provisioning Profile...'
        staging_profile = '%s/%s' % (_WORKING_DIRECTORY,
                                     vams._STAGING_PROVISIONING_PROFILE)
        vams.assetFetcher(staging_proifle_url, staging_profile)
コード例 #3
0
def downloadKeystoreFile(app_build_name, json):
    """
    Downloads the Android keystore file for a given app and writes it to local location
    :param app_build_name:
        The short name of the app to download the keystore file for. (old folder name)

    :param json:
        The json object containing the keystore file asset
    :return:
    """

    keystore_url = json['keystore']
    if keystore_url:
        new_file = '%s.keystore' % app_build_name

        if _CONSOLE_OUTPUT:
            print 'Downloading %s keystore file' % new_file
            print ''

        keystore_file = '%s/%s' % (_WORKING_DIRECTORY, new_file)
        vams.assetFetcher(keystore_url, keystore_file)