Create application.properties for a given application.
499059
def main():
    """"""
    logging.basicConfig(format=LOGGING_FORMAT)

    parser = argparse.ArgumentParser(description=main.__doc__)

    add_debug(parser)
    add_app(parser)
    add_env(parser)
    add_properties(parser)
    add_region(parser)
    add_artifact_path(parser)
    add_artifact_version(parser)

    args = parser.parse_args()

    logging.getLogger(__package__.split('.')[0]).setLevel(args.debug)

    LOG.debug('Args: %s', vars(args))

    rendered_props = get_properties(args.properties)
    if rendered_props['pipeline']['type'] == 's3':
        s3app = S3Apps(app=args.app, env=args.env, region=args.region, prop_path=args.properties)
        s3app.create_bucket()

        s3deploy = S3Deployment(
            app=args.app,
            env=args.env,
            region=args.region,
            prop_path=args.properties,
            artifact_path=args.artifact_path,
            artifact_version=args.artifact_version)
        s3deploy.upload_artifacts()
    else:
        init_properties(**vars(args))
177668
def _init_application(self, application=None):
        """"""
        if application:
            self.application = application
        else:
            self.application = self.make_application()
392643
function create(appName, callback) {
    commons.post(format('/%s/apps/', deis.version), {
      id: appName
    }, callback);
  }
450574
private void createApplication() {
        String schema = getSchema();
        ContentType contentType = null;
        if (m_config.schema.toLowerCase().endsWith(".json")) {
            contentType = ContentType.APPLICATION_JSON;
        } else if (m_config.schema.toLowerCase().endsWith(".xml")) {
            contentType = ContentType.TEXT_XML;
        } else {
            logErrorThrow("Unknown file type for schema: {}", m_config.schema);
        }
        
        try {
            m_logger.info("Creating application '{}' with schema: {}", m_config.app, m_config.schema);
            m_client.createApplication(schema, contentType);
        } catch (Exception e) {
            logErrorThrow("Error creating schema: {}", e);
        }
        
        try {
            m_session = m_client.openApplication(m_config.app);
        } catch (RuntimeException e) {
            logErrorThrow("Application '{}' not found after creation: {}.", m_config.app, e.toString());
        }
        String ss = m_session.getAppDef().getStorageService();
        if (!Utils.isEmpty(ss) && ss.startsWith("OLAP")) {
            m_bOLAPApp = true;
        }
        loadTables();
    }
1145753
def app_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/apps.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
627687
def custom_properties(self, props):
        
        fprops = javabridge.make_instance("java/io/File", "(Ljava/lang/String;)V", props)
        javabridge.call(self.jobject, "setCustomPropsFile", "(Ljava/io/File;)V", fprops)
224969
def addApplication(self, name, version=None, path=None, disk_num=0, soft=-1):
        """"""

        fapp = Features()
        fapp.features.append(Feature("name", "=", name))
        if version:
            fapp.features.append(Feature("version", "=", version))
        if path:
            fapp.features.append(Feature("path", "=", path))
        self.features.append(Feature("disk.%d.applications" % disk_num, "contains", fapp, soft > 0))
44016
public VDirectory createApplication(String appName) {
        Tenant tenant = new Tenant(TenantService.instance().getDefaultTenantDef());
        return createApplication(tenant, appName);
	}
676219
void putApp(Context context) {
    try {
      PackageManager packageManager = context.getPackageManager();
      PackageInfo packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
      Map<String, Object> app = createMap();
      putUndefinedIfNull(app, APP_NAME_KEY, packageInfo.applicationInfo.loadLabel(packageManager));
      putUndefinedIfNull(app, APP_VERSION_KEY, packageInfo.versionName);
      putUndefinedIfNull(app, APP_NAMESPACE_KEY, packageInfo.packageName);
      app.put(APP_BUILD_KEY, String.valueOf(packageInfo.versionCode));
      put(APP_KEY, app);
    } catch (PackageManager.NameNotFoundException e) {
      // ignore
    }
  }
828277
public static void loadApplicationBindings( Application app ) {

		File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
		File appBindingsFile = new File( descDir, APP_BINDINGS_FILE );

		Logger logger = Logger.getLogger( ConfigurationUtils.class.getName());
		Properties props = Utils.readPropertiesFileQuietly( appBindingsFile, logger );
		for( Map.Entry<?,?> entry : props.entrySet()) {
			for( String part : Utils.splitNicely((String) entry.getValue(), "," )) {
				if( ! Utils.isEmptyOrWhitespaces( part ))
					app.bindWithApplication((String) entry.getKey(), part );
			}
		}
	}
348818
public static void saveApplicationBindings( Application app ) {

		File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
		File appBindingsFile = new File( descDir, APP_BINDINGS_FILE );

		// Convert the bindings map
		Map<String,String> format = new HashMap<> ();
		for( Map.Entry<String,Set<String>> entry : app.getApplicationBindings().entrySet()) {
			String s = Utils.format( entry.getValue(), ", " );
			format.put( entry.getKey(), s );
		}

		// Save it
		Properties props = new Properties();
		props.putAll( format );

		try {
			Utils.createDirectory( descDir );
			Utils.writePropertiesFile( props, appBindingsFile );

		} catch( IOException e ) {
			Logger logger = Logger.getLogger( ConfigurationUtils.class.getName());
			logger.severe( "Failed to save application bindings for " + app + ". " + e.getMessage());
			Utils.logException( logger, e );
		}
	}
248114
def create_app():
    """"""
    global QT_APP
    QT_APP = QApplication.instance()
    if QT_APP is None:  # pragma: no cover
        QT_APP = QApplication(sys.argv)
    return QT_APP
806460
public Map<String, Object> getApplicationProperties(Map<String, Object> properties)
    {
        if (properties == null)
            return null;
        Map<String, Object> propApp = new Hashtable<String,Object>();
        if (properties.get(DBParams.LANGUAGE) != null)
            propApp.put(DBParams.LANGUAGE, properties.get(DBParams.LANGUAGE));
        if (properties.get(DBParams.DOMAIN) != null)
            propApp.put(DBParams.DOMAIN, properties.get(DBParams.DOMAIN));
        return propApp;
    }
1042162
public void addDatabaseProperties(Map<String,Object> properties)
    {
        Map<String,Object> propRequest = this.getRequestProperties(this.getServletRequest(), false);
        if (propRequest != null)
        {   // Also move any application params up.
            for (String key : propRequest.keySet())
            {   // Move these params to the application
                if ((key.endsWith(BaseDatabase.DBSHARED_PARAM_SUFFIX))
            		|| (key.endsWith(BaseDatabase.DBUSER_PARAM_SUFFIX))
                    || (key.equals(DBConstants.MODE))
                    || (key.equals(DBConstants.SYSTEM_NAME)))
                		properties.put(key, propRequest.get(key));
            }
        }        
    }
1049103
def appproperties():
    
    appprops = makeelement('Properties', nsprefix='ep')
    appprops = etree.fromstring(
        '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Properties x'
        'mlns="http://schemas.openxmlformats.org/officeDocument/2006/extended'
        '-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocum'
        'ent/2006/docPropsVTypes"></Properties>')
    props =\
        {'Template':             'Normal.dotm',
         'TotalTime':            '6',
         'Pages':                '1',
         'Words':                '83',
         'Characters':           '475',
         'Application':          'Microsoft Word 12.0.0',
         'DocSecurity':          '0',
         'Lines':                '12',
         'Paragraphs':           '8',
         'ScaleCrop':            'false',
         'LinksUpToDate':        'false',
         'CharactersWithSpaces': '583',
         'SharedDoc':            'false',
         'HyperlinksChanged':    'false',
         'AppVersion':           '12.0000'}
    for prop in props:
        appprops.append(makeelement(prop, tagtext=props[prop], nsprefix=None))
    return appprops
588437
def init_app(self, app):
        """"""
        prefix_len = len(self.prefix)
        for varname, value in os.environ.items():
            if not varname.startswith(self.prefix):
                continue

            # Prepare values
            varname = varname[prefix_len:]
            value = value or app.config.get(varname)

            # Evaluate value
            try:
                value = ast.literal_eval(value)
            except (SyntaxError, ValueError):
                pass

            # Set value
            app.config[varname] = value
1233708
def create_application_configuration(self, name, properties, description=None):
        
        if not hasattr(self, 'applicationConfigurations'):
            raise NotImplementedError()

        cv = ApplicationConfiguration._props(name, properties, description)

        res = self.rest_client.session.post(self.applicationConfigurations,
            headers = {'Accept' : 'application/json'},
            json=cv)
        _handle_http_errors(res)
        return ApplicationConfiguration(res.json(), self.rest_client)