Show or change the configuration
323264
def cli(ctx, setkv, copyk, delk,showtype):
    """"""

    if not ctx.bubble:
        ctx.say_yellow(
            'There is no bubble present, will not show or set the config')
        raise click.Abort()

    new_cfg = flat(ctx, ctx.cfg)
    ctx.say('current config', stuff=ctx.cfg, verbosity=10)
    ctx.say('current flat config with meta', stuff=new_cfg, verbosity=100)
    new_cfg_no_meta = {}
    meta_ends = ['_doct_as_key',
                 '_doct_level',
                 '___bts_flat_',
                 '___bts_flat_star_path_',
                 '___bts_flat_star_select_']

    lkeys = list(new_cfg.keys())
    for k in lkeys:
        addkey = True
        # ctx.say('k:'+k)
        if k.startswith('___bts_'):
            addkey = False
        for meta_end in meta_ends:
            if k.endswith(meta_end):
                addkey = False
        if addkey:
            # ctx.say('adding k:'+k)
            new_cfg_no_meta[k] = new_cfg[k]
        else:
            pass
            # ctx.say('not adding meta k:'+k)
    ctx.say('current flat config without metakeys',
            stuff=new_cfg_no_meta,
            verbosity=3)
    if not setkv and not copyk and not delk:
        ctx.say('current configuration')
        for k, v in new_cfg_no_meta.items():
            tstr=''
            if showtype:
                tstr=' type: '+TYPES[str(type(v))]
            ctx.say(' '+k+': '+str(v)+tstr)

    modified = 0
    if setkv:
        for key, value,vtype in setkv:
            ctx.say('setting k:%s,v:%s,t:%s'%(key,value,vtype))
            vtval='VALUE_NOT_SET'
            try:
                if vtype=="STRING":
                    vtval=str(value)
                if vtype=="INTEGER":
                    vtval=int(value)
                if vtype=="FLOAT":
                    vtval=float(value)
                if vtype=="BOOLEAN":
                    if value.lower() in TRUES:
                        vtval=True
                    if value.lower() in FALSES:
                        vtval=False
                    if vtval not in [True,False]:
                        ctx.cry("boolean value must be one of (case insensitive):",
                                stuff={'True':TRUES,'False':FALSES})
                        raise TypeError()
            except Exception as e:
                ctx.cry('cannot set k:%s,v:%s,t:%s:'%(key,value,vtype))
                raise e
            if vtval != 'VALUE_NOT_SET':
                new_cfg[str(key)] = vtval
                modified += 1
            else:
                ctx.cry('cannot set k:%s,v:%s,t:%s:typed value is not set yet'%(key,value,vtype))
    if copyk:
        for srckey, destkey in copyk:
            if srckey.endswith('.*'):
                src_val = get_flat_path(ctx, new_cfg, srckey)
                for k in src_val:
                    # TODO: use magic for sep
                    sep = '.'
                    new_cfg[str(destkey + sep + k)] = str(src_val[k])
                modified += 1
            else:
                if srckey in new_cfg:
                    new_cfg[str(destkey)] = new_cfg[srckey]
                    modified += 1

    if delk:
        if delk.endswith('.*'):
            # fix PY3: RuntimeError: dictionary changed size during iteration
            lkeys = list(new_cfg.keys())
            for k in lkeys:
                if k.startswith(delk[:-2]):
                    del(new_cfg[k])
                    modified += 1

        else:
            if delk in new_cfg:
                del(new_cfg[delk])
                modified += 1

    if modified:
        ctx.say('new flat config', stuff=new_cfg, verbosity=100)
        fat_cfg = unflat(ctx, new_cfg)
        ctx.say('new config, #changes:'+str(modified), verbosity=3)
        ctx.say('new config', stuff=fat_cfg, verbosity=30)
        fat_cfg = unflat(ctx, new_cfg)
        doct_fat_cfg = BubbleDoct(fat_cfg)
        ctx.say('new config fat doct', stuff=doct_fat_cfg, verbosity=100)
        res = put_config(ctx, YCFG=BubbleDoct(doct_fat_cfg))
        ctx.say('put config res:', stuff=res, verbosity=10)

    return True
1330259
def show():
    
    if not is_configured():
        raise JutException('No configurations available, please run: `jut config add`')

    info('Available jut configurations:')
    index = 0
    for configuration in _CONFIG.sections():
        username = _CONFIG.get(configuration, 'username')
        app_url = _CONFIG.get(configuration, 'app_url')

        if app_url != defaults.APP_URL:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s@%s (default)', index + 1, username, app_url)
            else:
                info(' %d: %s@%s', index + 1, username, app_url)

        else:
            if _CONFIG.has_option(configuration, 'default'):
                info(' %d: %s (default)' % (index + 1, username))
            else:
                info(' %d: %s' % (index + 1, username))

        index += 1
201921
def configure(self, options, conf):
        
        self.conf = conf
        if hasattr(options, self.enable_opt):
            self.enabled = getattr(options, self.enable_opt)
261510
def add_configuration(options):
    
    if options.username != None:
        username = options.username
    else:
        username = prompt('Username: ')

    if options.password != None:
        password = options.password
    else:
        password = prompt('Password: ', hide_input=not options.show_password)

    if options.app_url != None:
        app_url = options.app_url
    else:
        app_url = prompt('App URL (default: https://app.jut.io just hit enter): ')

    if app_url.strip() == '':
        app_url = 'https://app.jut.io'

    section = '%s@%s' % (username, app_url)

    if config.exists(section):
        raise JutException('Configuration for "%s" already exists' % section)

    token_manager = auth.TokenManager(username=username,
                                      password=password,
                                      app_url=app_url)

    authorization = authorizations.get_authorization(token_manager,
                                                     app_url=app_url)
    client_id = authorization['client_id']
    client_secret = authorization['client_secret']

    deployment_name = default_deployment(app_url,
                                         client_id,
                                         client_secret)

    config.add(section, **{
        'app_url': app_url,
        'deployment_name': deployment_name,
        'username': username,
        'client_id': client_id,
        'client_secret': client_secret
    })

    if options.default:
        config.set_default(name=section)
    else:
        default_configuration(interactive=False)
352450
def show_settings(self):
        
        self.notes.config.put_values()
        self.overview.config.put_values()
        self.settings.config.put_values()
        self.spectrum.config.put_values()
        self.traces.config.put_values()
        self.video.config.put_values()

        self.settings.show()
178356
def with_updated_configuration(self, options=None,
                                   attribute_options=None):
        
        return self._mapping.with_updated_configuration(options=options,
                                                        attribute_options=
                                                            attribute_options)
416786
def edit_preferences(self):
        """"""
        from spyder.preferences.configdialog import ConfigDialog
        dlg = ConfigDialog(self)
        dlg.size_change.connect(self.set_prefs_size)
        if self.prefs_dialog_size is not None:
            dlg.resize(self.prefs_dialog_size)
        for PrefPageClass in self.general_prefs:
            widget = PrefPageClass(dlg, main=self)
            widget.initialize()
            dlg.add_page(widget)
        for plugin in [self.workingdirectory, self.editor,
                       self.projects, self.ipyconsole,
                       self.historylog, self.help, self.variableexplorer,
                       self.onlinehelp, self.explorer, self.findinfiles
                       ]+self.thirdparty_plugins:
            if plugin is not None:
                try:
                    widget = plugin.create_configwidget(dlg)
                    if widget is not None:
                        dlg.add_page(widget)
                except Exception:
                    traceback.print_exc(file=sys.stderr)
        if self.prefs_index is not None:
            dlg.set_current_index(self.prefs_index)
        dlg.show()
        dlg.check_all_settings()
        dlg.pages_widget.currentChanged.connect(self.__preference_page_changed)
        dlg.exec_()
425861
def do_config(self, arg):
        
        if arg['print']:
            self.print_config(arg)
        elif arg['reload']:
            self.reload_config(arg)
        else:
            self.help_server()
332078
def _config_options(self):
        """"""
        self._config_sortable(self._sortable)
        self._config_drag_cols(self._drag_cols)
616095
def do_edit_settings(fake):
    """"""

    path = resources.user.open('config.ini').name

    click.echo('Legit Settings:\n')

    for (option, _, description) in legit_settings.config_defaults:
        click.echo(columns([crayons.yellow(option), 25], [description, None]))
    click.echo("")  # separate settings info from os output

    if fake:
        click.echo(crayons.red('Faked! >>> edit {}'.format(path)))
    else:
        click.edit(path)
1230450
def configurationChangeAcknowledge():
    """"""
    a = TpPd(pd=0x6)
    b = MessageType(mesType=0x31)  # 00110001
    c = MobileId()
    packet = a / b / c
    return packet
825190
def reload_configuration(self, event):
        """"""

        if event.target == self.uniquename:
            self.log('Reloading configuration')
            self._read_config()
727275
def show(all_keys):
    """"""
    if not config_file_exists():
        echo_info('No config file found! Please try `ddev config restore`.')
    else:
        if all_keys:
            echo_info(read_config_file().rstrip())
        else:
            echo_info(read_config_file_scrubbed().rstrip())
1202490
def update_configuration(configuration):
    
    for key, val in REQUIRED_SETTINGS.items():
        if val in ["$username", "$groupname"]:
            val = get_username()

        configuration = conf_writer.add_or_update(configuration, key, val)

    return configuration
926485
def show(config_file=False):
    '''
    
    '''
    cmd = 'sysctl'
    ret = {}
    out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
    for line in out.splitlines():
        if not line or '=' not in line:
            continue
        comps = line.split('=', 1)
        ret[comps[0]] = comps[1]
    return ret
1005773
protected function configure()
    {
        $configureSettingGroup = $this->cliHelper->confirmAction('Would you like to change the settings?');
        if (!$configureSettingGroup) {
            return;
        }
        
        $this->configureSettings($this->configurationManager->getSettings());
    }
160544
def configured_options(self):
        """"""
        stdout_lines = self._check_output(['config', '--list']).splitlines()
        return {key: value for key, value in [line.split('=') for line in stdout_lines]}