Check command line arguments and run update function.
516757
def update_mode(arg_namespace):
    """"""
    try:
        updater.update(custom_sources=arg_namespace.custom)
    except (PermissionError, FileNotFoundError) as exception:
        if isinstance(exception, PermissionError):
            print('No write permission for current working directory.')
        if isinstance(exception, FileNotFoundError):
            print('Necessary resources for updating not found in current '
                  'working directory.')
1054617
def run():
    """"""
    _parser_options()
    set_verbose(args["verbose"])
    
    if _check_global_settings():
        _load_db()
    else:
        exit(-1)

    #Check the server configuration against the script arguments passed in.
    _setup_server()

    if args["rollback"]:
        _server_rollback()
        okay("The server rollback appears to have been successful.")
        exit(0)

    _server_enable()    
    _list_repos()
    _handle_install()
    
    #This is the workhorse once a successful installation has happened.
    _do_cron()
535846
def _check_cmd(call):
    '''
    
    '''
    if call['retcode'] != 0:
        comment = ''
        std_err = call.get('stderr')
        std_out = call.get('stdout')
        if std_err:
            comment += std_err
        if std_out:
            comment += std_out

        raise CommandExecutionError('Error running command: {0}'.format(comment))

    return call
1074387
def update(self, client):
        """"""
        update_cmd = "{sudo} '{refresh};{update}'".format(
            sudo=self.get_sudo_exec_wrapper(),
            refresh=self.get_refresh_repo_cmd(),
            update=self.get_update_cmd()
        )

        out = ''
        try:
            out = ipa_utils.execute_ssh_command(
                client,
                update_cmd
            )
        except Exception as error:
            raise IpaDistroException(
                'An error occurred updating instance: %s' % error
            )
        return out
858629
def process_args_from_command_line(self):
        """"""
        # Yes, this is ugly, but we don't want to interfere with setup.py's own
        # option handling
        opts_to_remove = []
        for idx, option in enumerate(sys.argv):
            if not option.startswith("--"):
                continue
            if option == "--static":
                opts_to_remove.append(idx)
                self.static_extension = True
            elif option == "--no-download":
                opts_to_remove.append(idx)
                self.download_igraph_if_needed = False
            elif option == "--no-pkg-config":
                opts_to_remove.append(idx)
                self.use_pkgconfig = False
            elif option == "--no-progress-bar":
                opts_to_remove.append(idx)
                self.show_progress_bar = False
            elif option == "--no-wait":
                opts_to_remove.append(idx)
                self.wait = False                
            elif option.startswith("--c-core-version"):
                opts_to_remove.append(idx)
                if option == "--c-core-version":
                    value = sys.argv[idx+1]
                    opts_to_remove.append(idx+1)
                else:
                    value = option.split("=", 1)[1]
                self.c_core_versions = [value]
            elif option.startswith("--c-core-url"):
                opts_to_remove.append(idx)
                if option == "--c-core-url":
                    value = sys.argv[idx+1]
                    opts_to_remove.append(idx+1)
                else:
                    value = option.split("=", 1)[1]
                self.c_core_url = value

        for idx in reversed(opts_to_remove):
            sys.argv[idx:(idx+1)] = []
1043013
def run(self, argv):
        """"""
        command = argv[0]
        handlers = { 
            'clean': self.clean,
            'create': self.create,
            'disable': self.disable,
            'enable': self.enable,
            'list': self.list,
            'update': self.update,
        }
        handler = handlers.get(command, None)
        if handler is None:
            error("Unrecognized command: %s" % command, 2)
        handler(argv[1:])
1326669
def update(args):
    
    # Check specifying some new values
    if ((not args.__dict__.get('new_type') and
         not args.__dict__.get('new_content') and
         not args.__dict__.get('new_ttl') and
         not args.__dict__.get('new_priority'))):
        utils.error("Not update any values.")

    args.__dict__['search'] = (args.__dict__.get('name') + ',' +
                               args.__dict__.get('rtype') + ',' +
                               args.__dict__.get('content'))

    args.__dict__['raw_flag'] = True
    data = get(args)
    if len(data.get('records')) == 1:
        cur_ttl = data.get('records')[0].get('ttl')
        cur_priority = data.get('records')[0].get('priority')
    elif len(data.get('records')) > 1:
        utils.error("Match multiple records")
    else:
        utils.error("No match records")

    new_args = copy.copy(args)

    if new_args.__dict__.get('new_type'):
        new_args.__dict__['rtype'] = new_args.__dict__.get('new_type')

    if new_args.__dict__.get('new_content'):
        new_args.__dict__['content'] = new_args.__dict__.get('new_content')

    if new_args.__dict__.get('new_ttl'):
        new_args.__dict__['ttl'] = new_args.__dict__.get('new_ttl')
    else:
        new_args.__dict__['ttl'] = cur_ttl

    if new_args.__dict__.get('new_priority'):
        new_args.__dict__['priority'] = new_args.__dict__.get('new_priority')
    else:
        if cur_priority:
            new_args.__dict__['priority'] = cur_priority

    delete(args)
    create(new_args)
257124
def update(self, argv):
        """"""

        if len(argv) == 0: 
            error("Command requires an index name", 2)
        name = argv[0]

        if name not in self.service.indexes:
            error("Index '%s' does not exist" % name, 2)
        index = self.service.indexes[name]

        # Read index metadata and construct command line parser rules that 
        # correspond to each editable field.

        # Request editable fields
        fields = self.service.indexes.itemmeta().fields.optional

        # Build parser rules
        rules = dict([(field, {'flags': ["--%s" % field]}) for field in fields])

        # Parse the argument vector
        opts = cmdline(argv, rules)

        # Execute the edit request
        index.update(**opts.kwargs)
990162
def run(self):
        """"""
        if len(self._argv) > 1 and len(self._argv[1]) > 0:
            oper = self._argv[1]
        else:
            oper = 'fetch'
        if oper == 'fetch':
            ret = self.fetch()
        elif oper == 'config':
            ret = self.config()
            if ret and self._dirtyConfig:
                ret = self.fetch()
        elif oper == 'autoconf':
            ret = self.autoconf()
            if ret:
                print "yes"
            else:
                print "no"
            ret = True
        elif oper == 'suggest':
            ret = self.suggest()
        else:
            raise AttributeError("Invalid command argument: %s" % oper)
        return ret
1215888
def update(self, **kwargs):
        """"""
        assert not self.called
        self.kw.update(kwargs)
        return self
300560
def update(self, *args, **kwargs):
        '''
        
        '''
        preprocess = kwargs.get('preprocess')
        for s in args:
            for e in s:
                self._dict_set(preprocess(e) if preprocess else e, True)
796009
def run_program(program, *args):
    """"""
    real_args = [program]
    real_args.extend(args)
    logging.debug(_('check_output arguments: %s'), real_args)
    check_output(real_args, universal_newlines=True)
1065408
def run(self, cmd):
        """"""
        print datetime.datetime.now()
        output = subprocess.Popen(cmd, shell=True)
        output = output.communicate()[0]
        print output
101662
def run(self, args):
        
        changes_detected = self.detect_changes()
        message = self.get_message(changes_detected)
        print(message)
        return int(changes_detected)
958463
def run(cmd, *args, **kwargs):
    """"""
    log.info('> ' + list2cmdline(cmd))
    kwargs.setdefault('cwd', here)
    kwargs.setdefault('shell', sys.platform == 'win32')
    if not isinstance(cmd, list):
        cmd = cmd.split()
    return check_call(cmd, *args, **kwargs)
791361
def check_output(args):
    """"""
    log.debug('run: %s', args)
    out = subprocess.check_output(args=args).decode('utf-8')
    log.debug('out: %r', out)
    return out
1050942
def update(self):
        """"""
        for linenum in reversed(sorted(self.updates)):
            self.replace_baseline_repr(linenum, self.updates[linenum])

        if not self.TEST_MODE:
            path = '{}.update{}'.format(*os.path.splitext(self.path))
            with io.open(path, 'w', encoding='utf-8') as fh:
                fh.write('\n'.join(self.lines))
            print('UPDATE: {}'.format(self.showpath(path)))