Dispatches the request to the plugins update_catalog method
432505
def GetMetricTypes(self, request, context):
        """"""
        LOG.debug("GetMetricTypes called")
        try:
            metrics = self.plugin.update_catalog(ConfigMap(pb=request.config))
            return MetricsReply(metrics=[m.pb for m in metrics])
        except Exception as err:
            msg = "message: {}\n\nstack trace: {}".format(
                err, traceback.format_exc())
            return MetricsReply(metrics=[], error=msg)
1127906
def update_plugin(plugin_id):
    
    try:
        instance = CMSPlugin.objects.get(id=plugin_id).get_plugin_instance()[0]
        instance.update()
    except:
        return None, 0
    return instance, instance.posts.count()
48012
protected function updateOrder()
    {
        if (!isset($this->params['order_number'])) {
            throw new ShopgateLibraryException(ShopgateLibraryException::PLUGIN_API_NO_ORDER_NUMBER);
        }
        /** @var ShopgateOrder[] $orders */
        $orders = $this->merchantApi->getOrders(
            array(
                'order_numbers[0]' => $this->params['order_number'],
                'with_items'       => 1,
            )
        )->getData();

        if (empty($orders)) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                '"order" not set or empty. Response: ' . var_export($orders, true)
            );
        }

        if (count($orders) > 1) {
            throw new ShopgateLibraryException(
                ShopgateLibraryException::MERCHANT_API_INVALID_RESPONSE,
                'more than one order in response. Response: ' . var_export($orders, true)
            );
        }

        $payment  = 0;
        $shipping = 0;

        if (isset($this->params['payment'])) {
            $payment = (int)$this->params['payment'];
        }
        if (isset($this->params['shipping'])) {
            $shipping = (int)$this->params['shipping'];
        }

        $orders[0]->setUpdatePayment($payment);
        $orders[0]->setUpdateShipping($shipping);

        if (empty($this->response)) {
            $this->response = new ShopgatePluginApiResponseAppJson($this->trace_id);
        }

        $orderData = $this->plugin->updateOrder($orders[0]);
        if (is_array($orderData)) {
            $this->responseData = $orderData;
        } else {
            $this->responseData['external_order_id']     = $orderData;
            $this->responseData['external_order_number'] = null;
        }
    }
109593
def csw_global_dispatch_by_catalog(request, catalog_slug):
    """"""

    catalog = get_object_or_404(Catalog, slug=catalog_slug)

    if catalog:  # define catalog specific settings
        url = settings.SITE_URL.rstrip('/') + request.path.rstrip('/')
        return csw_global_dispatch(request, url=url, catalog_id=catalog.id)
1157373
def update
      if @resource.update(resource_params)
        redirect_to [main_app, @resource], notice: t('.notice', default: update_message)
      else
        render :edit
      end
    end
295482
def update(self):
        """"""
        # For each plugins, call the update method
        for p in self._plugins:
            if self._plugins[p].is_disable():
                # If current plugin is disable
                # then continue to next plugin
                continue

            # Set the input method to SNMP
            self._plugins[p].input_method = 'snmp'
            self._plugins[p].short_system_name = self.system_name

            # Update the stats...
            try:
                self._plugins[p].update()
            except Exception as e:
                logger.error("Update {} failed: {}".format(p, e))
            else:
                # ... the history
                self._plugins[p].update_stats_history()
                # ... and the views
                self._plugins[p].update_views()
922054
def update
      respond_to do |wants|
        result = resource_get.update_attributes(resource_params)
        call_hook :after_update_attributes, result
        if result
          flash[:notice] = t 'messages.record_updated', model: t("models.#{resource_name}")
          wants.html { redirect_to(resource_get) }
          wants.json  { head :ok }
        else
          wants.html { render :action => "edit" }
          wants.json  { render :json => resource_get.errors, :status => :unprocessable_entity }
        end
      end
    end
1070545
def update(self, **kwargs):
        
        query = self._build_query()
        connection = get_es_connection(self.es_url, self.es_kwargs)
        results = connection.search(query, indices=self.index, doc_types=self.type,
                                             model=self.model, scan=True)
        for item in results:
            item.update(kwargs)
            item.save(bulk=True)
        connection.flush_bulk(True)
        # Clear the result cache, in case this QuerySet gets reused.
        self._result_cache = None
1134575
def dispatch(self):
        ''
        import flask
        body = flask.request.get_json()
        return self. dispatch_with_args(body, argMap=dict())
214179
public function updateRegistry()
    {
        if (is_cli()) {
            output()->verbose(
                (new Format())
                    ->setContextualClass(Format::WARNING)
                    ->setString(language()->getLine('CLI_REGISTRY_LANGUAGE_VERB_UPDATE_START'))
                    ->setNewLinesBefore(1)
                    ->setNewLinesAfter(2)
            );
        }

        $cacheItemPool = cache()->getObject('default');

        if (cache()->exists('registry')) {
            $cacheItemPool = cache()->getObject('registry');
        }

        if ($cacheItemPool instanceof CacheItemPoolInterface) {
            $this->registry = $this->fetchRegistry();
            $cacheItemPool->save(new Item('o2languages', $this->registry, false));
        }

        if (count($this->registry) and is_cli()) {
            output()->verbose(
                (new Format())
                    ->setContextualClass(Format::SUCCESS)
                    ->setString(language()->getLine('CLI_REGISTRY_LANGUAGE_VERB_UPDATE_SUCCESS'))
                    ->setNewLinesBefore(1)
                    ->setNewLinesAfter(2)
            );
        } elseif (is_cli()) {
            output()->verbose(
                (new Format())
                    ->setContextualClass(Format::DANGER)
                    ->setString(language()->getLine('CLI_REGISTRY_LANGUAGE_VERB_UPDATE_FAILED'))
                    ->setNewLinesBefore(1)
                    ->setNewLinesAfter(2)
            );
        }
    }
1310767
def dispatch_request(self, *args, **kwargs):
        
        self.args = args
        self.kwargs = kwargs
        self.meth = request.method.lower()
        self.resource = current_app.blueprints.get(request.blueprint, None)

        if not any([self.meth in self.methods, self.meth.upper() in self.methods]):
            return self.return_error(405)

        self.process_before_request_hooks()

        resp = super(Endpoint, self).dispatch_request(*args, **kwargs)
        resp = self.make_response(resp)

        resp = self.process_after_request_hooks(resp)

        return resp
592591
def update(self, product, linked_products, attributes):
        
        return bool(self.call('ol_catalog_product_link.assign',
            [product, linked_products, attributes]))
203121
def update(self, typ, id, **kwargs):
        
        return self._load(self._request(typ, id=id, method='PUT', data=kwargs))
878580
def run_update_cat(_):
    '''
    
    '''
    recs = MPost2Catalog.query_all().objects()
    for rec in recs:
        if rec.tag_kind != 'z':
            print('-' * 40)
            print(rec.uid)
            print(rec.tag_id)
            print(rec.par_id)

            MPost2Catalog.update_field(rec.uid, par_id=rec.tag_id[:2] + "00")
819676
void updateCatalog(String diffCmds, CatalogContext context)
    {
        if (m_shuttingDown) {
            return;
        }

        m_catalogContext = context;
        // Wipe out all the idle sites with stale catalogs.
        // Non-idle sites will get killed and replaced when they finish
        // whatever they started before the catalog update
        Iterator<MpRoSiteContext> siterator = m_idleSites.iterator();
        while (siterator.hasNext()) {
            MpRoSiteContext site = siterator.next();
            if (site.getCatalogCRC() != m_catalogContext.getCatalogCRC()
                    || site.getCatalogVersion() != m_catalogContext.catalogVersion) {
                site.shutdown();
                m_idleSites.remove(site);
                m_allSites.remove(site);
            }
        }
    }
40471
def update(request)
      if options[:multiple]
        cats = request.every(options[:category])
        cats.each do |cat|
          if cat || options[:nils]
            @categories[cat] ||= 0
            @categories[cat] += 1
          end
        end

      else
        cat = @categorizer.call(request)
        if cat || options[:nils]
          @categories[cat] ||= 0
          @categories[cat] += 1
        end
      end
    end
696789
def dispatch(self, request, *args, **kwargs):
        """"""
        self._add_next_and_user(request)
        return super(UpdateImageView, self).dispatch(request, *args, **kwargs)