Submit a new workflow (or update) to the methods repository.
960994
def meth_new(args):
    
    r = fapi.update_repository_method(args.namespace, args.method,
                                      args.synopsis, args.wdl, args.doc,
                                      args.comment)
    fapi._check_response_code(r, 201)
    if fcconfig.verbosity:
        print("Method %s installed to project %s" % (args.method,
                                                     args.namespace))
    return 0
1373192
private Event submit(final RequestContext context, final Credential credential,
                        final MessageContext messageContext) {
        if (repository.submit(context, credential)) {
            return new EventFactorySupport().event(this,
                CasWebflowConstants.TRANSITION_ID_AUP_ACCEPTED);
        }
        return error();
    }
553661
def submit_task(rel_path, cache_string, buffer):
    """"""
    global upload_queue
    global upload_thread
    upload_queue.put((rel_path, cache_string, buffer))

    if upload_thread is None or not upload_thread.is_alive():
        upload_thread = UploaderThread()
        upload_thread.start()
26950
public function postUpdate(LifecycleEventArgs $args): void
    {
        // Get the object and make sure it is what we need.
        $object = $args->getObject();
        if (!$object instanceof PublishableInterface) {
            return;
        }

        // Get the changeset from the unit of work.
        $uow = $args->getObjectManager()->getUnitOfWork();
        $changeset = $uow->getEntityChangeset($object);

        // If the published state changed fire the published event.
        if (isset($changeset['published'])
            && false === $changeset['published'][0]
            && true === $changeset['published'][1]) {
            $event = new EntityPublishedEvent($object);
            $this->event_dispatcher->dispatch(EntityPublishedEvent::NAME, $event);
        }
    }
509722
def new_action(self, method='GET', **kwargs):
        
        if method not in self.methods:
            raise TypeError('{} not in valid method(s): {}.'.format(method, self.methods))
        return Action(self, method, **kwargs)
1183700
def submit(self, call, *args, **kwargs):
        
        future = StoredFuture(call, *args, **kwargs)
        self._queue.put(future)
        self._ensure_worker()
        return future
998056
void submit() {

        try {
            List<CmsUUID> modifiedResources = undelete();
            m_context.finish(modifiedResources);
        } catch (Exception e) {
            m_context.error(e);
        }
    }
966152
void submit() {

        CmsResource target = m_context.getResources().get(0);
        String resPath = m_context.getCms().getSitePath(target);
        try {
            m_context.getCms().copyResourceToProject(resPath);

            m_context.finish(Collections.singletonList(target.getStructureId()));
        } catch (CmsException e) {
            m_context.error(e);
        }
    }
448034
def release(path, repository):
    """"""
    upgrader = InvenioUpgrader()
    logger = upgrader.get_logger()

    try:
        endpoints = upgrader.find_endpoints()

        if not endpoints:
            logger.error("No upgrades found.")
            click.Abort()

        depends_on = []
        for repo, upgrades in endpoints.items():
            depends_on.extend(upgrades)

        return recipe(path,
                      repository=repository,
                      depends_on=depends_on,
                      release=True,
                      output_path=output_path)

    except RuntimeError as e:
        for msg in e.args:
            logger.error(unicode(msg))
        raise
699081
def publish_if_new(cls):
    """"""
    message = cls.make_message()
    if message != cls.last_message:
      super(DashboardPubSub, cls).publish(message)
      cls.last_message = message
801170
function() {
            var newMethods = $._.$.iot.extraCAMethods();
            $._.$.log && $._.$.log.debug('Adding CA methods:' +
                                         JSON.stringify(Object
                                                        .keys(newMethods)));
            myUtils.mixin($.handler, newMethods, true);
        }
1161953
def save(self, status=None, callback_pos=None, id_workflow=None):
        """"""
        if self.model is None:
            raise WorkflowsMissingModel()

        with db.session.begin_nested():
            workflow_object_before_save.send(self)

            self.model.modified = datetime.now()
            if status is not None:
                self.model.status = status

            if id_workflow is not None:
                workflow = Workflow.query.filter_by(uuid=id_workflow).one()
                self.model.workflow = workflow

            # Special handling of JSON fields to mark update
            if self.model.callback_pos is None:
                self.model.callback_pos = list()
            elif callback_pos is not None:
                self.model.callback_pos = callback_pos
            flag_modified(self.model, 'callback_pos')

            if self.model.data is None:
                self.model.data = dict()
            flag_modified(self.model, 'data')

            if self.model.extra_data is None:
                self.model.extra_data = dict()
            flag_modified(self.model, 'extra_data')

            db.session.merge(self.model)

            if self.id is not None:
                self.log.debug("Saved object: {id} at {callback_pos}".format(
                    id=self.model.id or "new",
                    callback_pos=self.model.callback_pos
                ))
        workflow_object_after_save.send(self)
797217
def submit(self):
        """"""
        if self._dirty:
            self.save()

        self._connection.run(['submit', '-c', str(self._change)], marshal_output=False)
464784
public function update()
	{
		$mode = $this->output->getMode();

		if ($this->arguments->getOpt('f'))
		{
			if ($mode != 'minimal')
			{
				$this->output->addLine(
					'Updating the repository...',
					array(
						'color' => 'blue'
					),
					false
				);
			}

			// Check status and stash as needed
			if (!$this->mechanism->isClean())
			{
				$this->mechanism->stash();
			}

			// Create rollback point first
			$this->mechanism->createRollbackPoint();

			// Check whether or not we're allowing fast forward pulls only
			$allowNonFf = $this->arguments->getOpt('allow-non-ff');

			// Now do the update
			$response = $this->mechanism->update(false, $allowNonFf);
			if ($response['status'] == 'success')
			{
				// Now, check to see whether or not we need to go ahead and push this merge elsewhere
				if ($ref = $this->arguments->getOpt('git-auto-push-ref', false))
				{
					$response = $this->mechanism->push($ref);
					if ($response['status'] === 'success')
					{
						if ($mode != 'minimal')
						{
							$this->output->addLine(
								'complete',
								array(
									'color' => 'green'
								)
							);
						}
					}
					else
					{
						$this->output->addLine(
							strtolower($response['message']),
							array(
								'color' => 'red'
							)
						);
					}
				}
				else
				{
					if ($mode != 'minimal')
					{
						$this->output->addLine(
							'complete',
							array(
								'color' => 'green'
							)
						);
					}
				}

				// Also check to see if we need to update packages
				if ($this->arguments->getOpt('install-packages', false))
				{
					App::get('client')->call('repository:package', 'install', new Arguments([]), $this->output);
				}
			}
			else if ($response['status'] == 'fatal')
			{
				$this->output->addLine(
					strtolower($response['message']),
					array(
						'color' => 'red'
					)
				);
			}
			else
			{
				$this->output->addSpacer();
				$this->output->addRaw($response['raw']);
			}
		}
		else
		{
			$response = $this->mechanism->update();

			if (!empty($response))
			{
				if ($mode != 'minimal')
				{
					$this->output->addLine('The repository is behind by ' . count($response) . ' update(s):');
				}
				$logs = array();
				foreach ($response as $log)
				{
					if ($mode == 'minimal')
					{
						$this->output->addLine($log);
					}
					else
					{
						$logs[] = array(
							'message' => $log,
							'type' => array(
								'indentation' => 2,
								'color'       => 'blue'
							)
						);
					}
				}

				if ($mode != 'minimal')
				{
					$this->output->addLinesFromArray($logs);
				}
			}
			else
			{
				if ($mode != 'minimal')
				{
					$this->output->addLine('The repository is already up-to-date');
				}
			}
		}
	}
594662
def republish_collection(submitter, submitlog, next_minor_version,
                         collection_ident, plpy, revised=None):
    
    sql = '''
    INSERT INTO modules (portal_type, moduleid, uuid, version, name, created,
        revised, abstractid, licenseid, doctype, submitter, submitlog,
        stateid, parent, language, authors, maintainers, licensors,
        parentauthors, google_analytics, buylink, print_style,
        major_version, minor_version)
      SELECT m.portal_type, m.moduleid, m.uuid, m.version, m.name, m.created,
        {}, m.abstractid, m.licenseid, m.doctype, $3, $4,
        m.stateid, m.parent, m.language, m.authors, m.maintainers, m.licensors,
        m.parentauthors, m.google_analytics, m.buylink, m.print_style,
        m.major_version, $1
      FROM modules m
      WHERE m.module_ident = $2
    RETURNING module_ident
    '''
    if revised is None:
        sql = sql.format('CURRENT_TIMESTAMP')
        types = ('integer', 'integer', 'text', 'text')
        params = (next_minor_version, collection_ident, submitter, submitlog)
    else:
        sql = sql.format('$5')
        types = ('integer', 'integer', 'text', 'text', 'timestamp')
        params = (next_minor_version, collection_ident, submitter, submitlog,
                  revised)
    plan = plpy.prepare(sql, types)
    new_ident = plpy.execute(plan, params, 1)[0]['module_ident']

    plan = plpy.prepare("""\
        INSERT INTO modulekeywords (module_ident, keywordid)
        SELECT $1, keywordid
        FROM modulekeywords
        WHERE module_ident = $2""", ('integer', 'integer'))
    plpy.execute(plan, (new_ident, collection_ident,))

    plan = plpy.prepare("""\
        INSERT INTO moduletags (module_ident, tagid)
        SELECT $1, tagid
        FROM moduletags
        WHERE module_ident = $2""", ('integer', 'integer'))
    plpy.execute(plan, (new_ident, collection_ident,))

    plan = plpy.prepare("""\
        INSERT INTO module_files (module_ident, fileid, filename)
        SELECT $1, fileid, filename
        FROM module_files
        WHERE module_ident = $2 and filename != 'collection.xml'""",
                        ('integer', 'integer'))
    plpy.execute(plan, (new_ident, collection_ident,))
    return new_ident
804750
def _updateRepo(self, func, *args, **kwargs):
        
        # TODO how do we make this properly transactional?
        self._repo.open(datarepo.MODE_WRITE)
        try:
            func(*args, **kwargs)
            self._repo.commit()
        finally:
            self._repo.close()
225521
def _update_classmethod(self, oldcm, newcm):
        """"""
        # While we can't modify the classmethod object itself (it has no
        # mutable attributes), we *can* extract the underlying function
        # (by calling __get__(), which returns a method object) and update
        # it in-place.  We don't have the class available to pass to
        # __get__() but any object except None will do.
        self._update(None, None, oldcm.__get__(0), newcm.__get__(0))