Task entrypoint : Stage the app.yaml based application.
769227
@TaskAction
  public void stageAction() throws AppEngineException {
    getProject().delete(appYamlExtension.getStagingDirectory());
    getProject().mkdir(appYamlExtension.getStagingDirectory().getAbsolutePath());

    AppYamlProjectStaging staging = new AppYamlProjectStaging();
    staging.stageArchive(appYamlExtension.toAppYamlProjectStageConfiguration());
  }
1021624
def add_entrypoint(self, entry_point_group):
        """"""
        for ep in iter_entry_points(group=entry_point_group):
            if not resource_isdir(ep.module_name, 'translations'):
                continue
            dirname = resource_filename(ep.module_name, 'translations')
            self.add_path(dirname)
724867
def main():
    """"""
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers()

    appengine.register_commands(subparsers)
    requirements.register_commands(subparsers)
    pylint.register_commands(subparsers)

    args = parser.parse_args()
    args.func(args)
23097
def discover_process(self, path):
        
        if not path.lower().endswith(('.yml', '.yaml')):
            return []

        with open(path) as fn:
            schemas = yaml.load(fn, Loader=yaml.FullLoader)
        if not schemas:
            # TODO: Logger.
            # self.stderr.write("Could not read YAML file {}".format(schema_file))
            return []

        process_schemas = []
        for schema in schemas:
            if 'run' not in schema:
                continue

            # NOTE: This currently assumes that 'bash' is the default.
            if schema['run'].get('language', 'bash') != 'workflow':
                continue

            process_schemas.append(schema)

        return process_schemas
1346760
def quickstart():
    """"""
    import ballet.templating
    import ballet.util.log
    ballet.util.log.enable(level='INFO',
                           format=ballet.util.log.SIMPLE_LOG_FORMAT,
                           echo=False)
    ballet.templating.render_project_template()
1083186
protected function executeStage($stage, Node $node, Application $application, Deployment $deployment)
    {
        foreach (['before', 'tasks', 'after'] as $stageStep) {
            foreach (['_', $application->getName()] as $applicationName) {
                $label = $applicationName === '_' ? 'for all' : 'for application ' . $applicationName;

                if (isset($this->tasks['stage'][$applicationName][$stage][$stageStep])) {
                    $deployment->getLogger()->debug('Executing stage "' . $stage . '" (step "' . $stageStep . '") on "' . $node->getName() . '" ' . $label);
                    foreach ($this->tasks['stage'][$applicationName][$stage][$stageStep] as $task) {
                        $this->executeTask($task, $node, $application, $deployment, $stage);
                    }
                }
            }
        }
    }
989290
def define_staging_file_tasks(files, lib_path, stage_path, platf, ruby_ver)
      files.each do |gem_file|
        # ignore directories and the binary extension
        next if File.directory?(gem_file) || gem_file == "#{lib_path}/#{binary(platf)}"
        stage_file = "#{stage_path}/#{gem_file}"

        # copy each file from base to stage directory
        unless Rake::Task.task_defined?(stage_file) then
          directory File.dirname(stage_file)
          file stage_file => [File.dirname(stage_file), gem_file] do
            cp gem_file, stage_file
          end
        end

        # append each file to the copy task
        task "copy:#{@name}:#{platf}:#{ruby_ver}" => [stage_file]
      end
    end
977021
def discover_yaml(self):
        
        try:
            import yaml
            self.register('yaml', yaml.load, yaml.dump)
        except ImportError:
            pass
1193532
def init_app(self, app,
                 entry_point_group='invenio_workflows.workflows',
                 **kwargs):
        """"""
        app.config.setdefault(
            "WORKFLOWS_OBJECT_CLASS",
            "invenio_workflows.api.WorkflowObject"
        )
        state = _WorkflowState(
            app, entry_point_group=entry_point_group, **kwargs
        )
        app.extensions['invenio-workflows'] = state
        return state
887914
def process(self, stage):
        """"""
        self.logger.info("Processing pipeline stage '%s'", self.title)
        output = []
        for entry in stage:
            key = list(entry.keys())[0]
            if key == "env":
                self.pipeline.data.env_list[1].update(entry[key])
                self.logger.debug("Updating environment at level 1 with %s",
                                  self.pipeline.data.env_list[1])
                continue

            # if not "env" then it must be "tasks" (schema):
            tasks = Tasks(self.pipeline, re.match(r"tasks\(parallel\)", key) is not None)
            result = tasks.process(entry[key])
            for line in result['output']:
                output.append(line)
            if not result['success']:
                self.event.failed()
                return {'success': False, 'output': output}

        self.event.succeeded()
        return {'success': True, 'output': output}
690313
def init_app(self, app, entry_point_group='invenio_queues.queues'):
        """"""
        self.init_config(app)
        app.extensions['invenio-queues'] = _InvenioQueuesState(
            app,
            app.config['QUEUES_CONNECTION_POOL'],
            entry_point_group=entry_point_group
        )
        return app
1152757
def init_app(self, app,
                 entry_point_group_mappings='invenio_search.mappings',
                 entry_point_group_templates='invenio_search.templates',
                 **kwargs):
        
        self.init_config(app)

        app.cli.add_command(index_cmd)

        state = _SearchState(
            app,
            entry_point_group_mappings=entry_point_group_mappings,
            entry_point_group_templates=entry_point_group_templates,
            **kwargs
        )
        self._state = app.extensions['invenio-search'] = state
1037770
private void initializeStage() {
        // Define the stage title
        this.stage.setTitle(applicationTitle());

        // Define stage icons, the toolkit will use the best size
        final List<Image> stageIcons = stageIcons();
        if (stageIcons != null && !stageIcons.isEmpty()) {
            this.stage.getIcons().addAll(stageIcons);
        }

        // and allow customization
        customizeStage(this.stage);
    }
683053
def initiate_tasks(self):
        
        self.tasks_classes = TaskLoader().load_tasks(
            paths=self.configuration[Configuration.ALGORITHM][Configuration.TASKS][Configuration.PATHS])
985406
def entrypoint(args=None):
    

    mondrian.setup(excepthook=True)
    logger = logging.getLogger()
    logger.setLevel(settings.LOGGING_LEVEL.get())

    parser = argparse.ArgumentParser()
    parser.add_argument("--debug", "-D", action="store_true")

    subparsers = parser.add_subparsers(dest="command")
    subparsers.required = True

    commands = {}

    def register_extension(ext):
        nonlocal commands

        try:
            parser = subparsers.add_parser(ext.name)
            if isinstance(ext.plugin, type) and issubclass(ext.plugin, BaseCommand):
                # current way, class based.
                cmd = ext.plugin()
                cmd.add_arguments(parser)
                cmd.__name__ = ext.name
                commands[ext.name] = cmd.handle
            else:
                # old school, function based.
                commands[ext.name] = ext.plugin(parser)
        except Exception:
            logger.exception("Error while loading command {}.".format(ext.name))

    from stevedore import ExtensionManager

    mgr = ExtensionManager(namespace="bonobo.commands")
    mgr.map(register_extension)

    parsed_args = parser.parse_args(args).__dict__

    if parsed_args.pop("debug", False):
        settings.DEBUG.set(True)
        settings.LOGGING_LEVEL.set(logging.DEBUG)
        logger.setLevel(settings.LOGGING_LEVEL.get())

    logger.debug("Command: " + parsed_args["command"] + " Arguments: " + repr(parsed_args))

    # Get command handler, execute, rince.
    command = commands[parsed_args.pop("command")]
    command(**parsed_args)

    return 0
500271
@TaskAction
  public void stageAction() throws AppEngineException {
    getProject().delete(stageStandardExtension.getStagingDirectory());
    appCfg
        .newStaging(CloudSdkOperations.getDefaultHandler(getLogger()))
        .stageStandard(stageStandardExtension.toStageStandardConfiguration());
  }
956914
def launch(self, host="local", port=8080):
        """"""

        # Need to add in the appbar if many apps
        self.root.templateVars['app_bar'] = self.site_app_bar
        for fullRoute, _ in self.site_app_bar[1:]:
            parent, route = self.get_route(fullRoute)
            parent.__dict__[route].templateVars['app_bar'] = self.site_app_bar

        if host != "local":
            cherrypy.server.socket_host = '0.0.0.0'
        cherrypy.server.socket_port = port
        cherrypy.quickstart(self.root)