Get program options.
508638
def get_options(self):
        
        super(ScriptBaseWithConfig, self).get_options()

        self.config_dir = os.path.abspath(os.path.expanduser(self.options.config_dir
            or os.environ.get('PYRO_CONFIG_DIR', None)
            or self.CONFIG_DIR_DEFAULT))
        load_config.ConfigLoader(self.config_dir).load(self.OPTIONAL_CFG_FILES + self.options.config_file)
        if self.options.debug:
            config.debug = True

        for key_val in self.options.defines:
            try:
                key, val = key_val.split('=', 1)
            except ValueError, exc:
                raise error.UserError("Bad config override %r (%s)" % (key_val, exc))
            else:
                setattr(config, key, load_config.validate(key, val))
511239
def get_options(config=None):
    """"""
    if config is None:
        from . import config
        config.get = lambda key, default=None: getattr(config, key, default)

    base = {
        "components": config.get("COMPONENTS"),
        "signatures": config.get("SIGNATURES"),
        "commit_msg_template": config.get("COMMIT_MSG_TEMPLATE"),
        "commit_msg_labels": config.get("COMMIT_MSG_LABELS"),
        "alt_signatures": config.get("ALT_SIGNATURES"),
        "trusted": config.get("TRUSTED_DEVELOPERS"),
        "pep8": config.get("CHECK_PEP8", True),
        "pydocstyle": config.get("CHECK_PYDOCSTYLE", True),
        "license": config.get("CHECK_LICENSE", True),
        "pyflakes": config.get("CHECK_PYFLAKES", True),
        "ignore": config.get("IGNORE"),
        "select": config.get("SELECT"),
        "match": config.get("PYDOCSTYLE_MATCH"),
        "match_dir": config.get("PYDOCSTYLE_MATCH_DIR"),
        "min_reviewers": config.get("MIN_REVIEWERS"),
        "colors": config.get("COLORS", True),
        "excludes": config.get("EXCLUDES", []),
        "authors": config.get("AUTHORS"),
        "exclude_author_names": config.get("EXCLUDE_AUTHOR_NAMES"),
    }
    options = {}
    for k, v in base.items():
        if v is not None:
            options[k] = v
    return options
922128
def which(program):
    "  "

    head, _ = op.split(program)

    if head:
        if is_exe(program):
            return program
    else:
        for path in environ["PATH"].split(pathsep):
            exe_file = op.join(path, program)
            if is_exe(exe_file):
                return exe_file
    return None
1180332
function getOptions(provided)
{
    var options = provided || {};

    if (!options.documentView)
        options.documentView = {};
    if (!options.documentView.closeLabel)
        options.documentView.closeLabel = "Done";


    if (!options.navigationView)
        options.navigationView = {};
    if (!options.navigationView.closeLabel)
        options.navigationView.closeLabel = "Back";


    if (!options.email)
        options.email = {};
    if (!options.email.enabled)
        options.email.enabled = false;


    if (!options.print)
        options.print = {};
    if (!options.print.enabled)
        options.print.enabled = false;


    if (!options.openWith)
        options.openWith = {};
    if (!options.openWith.enabled)
        options.openWith.enabled = false;


    if (!options.bookmarks)
        options.bookmarks = {};
    if (!options.bookmarks.enabled)
        options.bookmarks.enabled = false;


    if (!options.search)
        options.search = {};
    if (!options.search.enabled)
        options.search.enabled = false;

    if (!options.autoClose)
        options.autoClose = {onPause: false};
    if (!options.autoClose.onPause)
        options.autoClose.onPause = false;

    if (!options.android)
        options.android = {};
    if (!options.android.viewerAppPackage)
        options.android.viewerAppPackage = 'de.sitewaerts.cleverdox.viewer';
    if (!options.android.viewerAppActivity)
        options.android.viewerAppActivity = 'DocumentViewerActivity';

    return options;
}
685454
def command_with_options(self):
        """"""
        if 'args' in self.config:
            return ' '.join((self.command, self.config['args']))
        return self.command
15578
def options(self):
        """"""
        arg = self.get(0)
        if arg.startswith('-') and not self.is_asking_for_help:
            return arg[1:]
        return ''.join(x for x in arg if x in 'dgktz')
491324
def options(self):
        '''
        
        '''
        conv = self.conv
        for python_value, label in self.choices:
            yield conv.from_python(python_value), label
904227
def options(self):
        
        if self.is_optionhandler:
            return types.string_array_to_list(javabridge.call(self.jobject, "getOptions", "()[Ljava/lang/String;"))
        else:
            return []
671525
def _get_options(self, style):
        
        return [self.opt[o][style]['name'] for o in self.opt]
137438
def _complete_options(self):
        """"""
        text = to_text_string(self.currentText())
        opts = glob.glob(text + "*")
        opts = sorted([opt for opt in opts if osp.isdir(opt)])
        self.setCompleter(QCompleter(opts, self))
        return opts
1033665
def load_options():
    """"""
    possible_defaults = (
        '/etc/proselintrc',
        os.path.join(proselint_path, '.proselintrc'),
    )
    options = {}
    has_overrides = False

    for filename in possible_defaults:
        try:
            options = json.load(open(filename))
            break
        except IOError:
            pass

    try:
        user_options = json.load(
            open(os.path.join(_get_xdg_config_home(), 'proselint', 'config')))
        has_overrides = True
    except IOError:
        pass

    # Read user configuration from the legacy path.
    if not has_overrides:
        try:
            user_options = json.load(
                open(os.path.join(os.path.expanduser('~'), '.proselintrc')))
            has_overrides = True
        except IOError:
            pass

    if has_overrides:
        if 'max_errors' in user_options:
            options['max_errors'] = user_options['max_errors']
        if 'checks' in user_options:
            for (key, value) in user_options['checks'].items():
                try:
                    options['checks'][key] = value
                except KeyError:
                    pass

    return options
1321387
def get_program_path():
    """"""

    src_folder = os.path.dirname(__file__)
    program_path = os.sep.join(src_folder.split(os.sep)[:-1]) + os.sep

    return program_path
987578
def selectedOptions(self) -> NodeList:
        """"""
        return NodeList(list(opt for opt in self.options if opt.selected))
278720
def get_config_from_options(**options):
    """"""
    data = []
    #  Set whether or not to daemonize.
    #  Unlike supervisord, our default is to stay in the foreground.
    data.append("[supervisord]\n")
    if options.get("daemonize",False):
        data.append("nodaemon=false\n")
    else:
        data.append("nodaemon=true\n")
    if options.get("pidfile",None):
        data.append("pidfile=%s\n" % (options["pidfile"],))
    if options.get("logfile",None):
        data.append("logfile=%s\n" % (options["logfile"],))
    #  Set which programs to launch automatically on startup.
    for progname in options.get("launch",None) or []:
        data.append("[program:%s]\nautostart=true\n" % (progname,))
    for progname in options.get("nolaunch",None) or []:
        data.append("[program:%s]\nautostart=false\n" % (progname,))
    #  Set which programs to include/exclude from the config
    for progname in options.get("include",None) or []:
        data.append("[program:%s]\nexclude=false\n" % (progname,))
    for progname in options.get("exclude",None) or []:
        data.append("[program:%s]\nexclude=true\n" % (progname,))
    #  Set which programs to autoreload when code changes.
    #  When this option is specified, the default for all other
    #  programs becomes autoreload=false.
    if options.get("autoreload",None):
        data.append("[program:autoreload]\nexclude=false\nautostart=true\n")
        data.append("[program:__defaults__]\nautoreload=false\n")
        for progname in options["autoreload"]:
            data.append("[program:%s]\nautoreload=true\n" % (progname,))
    #  Set whether to use the autoreloader at all.
    if options.get("noreload",False):
        data.append("[program:autoreload]\nexclude=true\n")
    return "".join(data)
683160
def get_programs():
    
    programs = []
    os.environ['PATH'] += os.pathsep + os.getcwd()
    for p in os.environ['PATH'].split(os.pathsep):
        if path.isdir(p):
            for f in os.listdir(p):
                if _is_executable(path.join(p, f)):
                    yield f
210618
def options(self, section):
        """"""
        try:
            opts = self._sections[section].copy()
        except KeyError:
            raise from_none(NoSectionError(section))
        opts.update(self._defaults)
        return list(opts.keys())
832463
def get_defaults(self):
        """"""
        # dont need 'required' to determine the default
        options = [copy.copy(opt) for opt in self._options]
        for opt in options:
            try:
                del opt.kwargs['required']
            except KeyError:
                pass
        parser = self.build_parser(options, permissive=True, add_help=False)
        parsed, _ = parser.parse_known_args([])
        return vars(parsed)