Esempio n. 1
0
 def fork_pygmentize_stdin(self):
     exit_val = 0
     try:
         exit_val = load_entry_point('pygments-hack==0.2', 'console_scripts', 'pygmentize')()                                                                                                                         
     except Exception:
         exit_val = load_entry_point('Pygments', 'console_scripts', 'pygmentize')()                                                                                                                         
     sys.exit(exit_val)
Esempio n. 2
0
    def run_tests(self, test_labels, extra_tests=None):
        # Remove stop word (--) from argument list again. This separates Django
        # command options from py.test ones.
        try:
            cut = sys.argv.index('--')
            args = sys.argv[:cut]
            options = sys.argv[cut+1:]
        except ValueError:
            args = sys.argv[1:]
            options = []

        # Filter out any option that was not meant for py.test (like "-v2").
        # TODO deal with options that take arguments (so far not used)
        args = filter(lambda x: x in ('-s', '-x', '-k', '--pdb'), args)

        try:
            entry_point = load_entry_point('py>=1.0.0', 'console_scripts', 'py.test')
        except ImportError:
            entry_point = load_entry_point('pytest>=2.0', 'console_scripts', 'py.test')

        self.setup_test_environment()
        old_config = self.setup_databases()
        result = entry_point(args + options)
        self.teardown_databases(old_config)
        self.teardown_test_environment()

        # TODO return number of failures and errors
        return result
Esempio n. 3
0
def before_scenario(context, scenario):
    """Prepare context for scenario."""
    if 'browser.firefox' in scenario.tags:
        driver_name = 'firefox'
    elif 'browser.chrome' in scenario.tags:
        driver_name = 'chrome'
    else:
        driver_name = getattr(settings, 'BDD_DEFAULT_BROWSER', 'chrome')
    params = {
        'driver_name': driver_name,
        'headless': getattr(settings, 'BDD_HEADLESS_BROWSER', False),
        'incognito': getattr(settings, 'BDD_INCOGNITO_BROWSER', False),
        'wait_time': getattr(settings, 'BDD_DEFAULT_WAIT_TIME', 5),
        'fullscreen': getattr(settings, 'BDD_FULLSCREEN_BROWSER', False),
    }
    language = {
        'intl.accept_languages': getattr(
            settings, 'BDD_BROWSER_LANGUAGE', 'en-US'
        )
    }
    if driver_name == 'firefox':
        params.update({
            'profile_preferences': language,
            'capabilities': {'moz:webdriverClick': False},
        })
    elif driver_name == 'chrome':
        load_entry_point('chromedriver-binary==74.0.3729.6.0', 'console_scripts', 'chromedriver-path')
        options = Options()
        options.add_experimental_option('prefs', language)
        params.update({
            'options': options
        })
    context.browser = Browser(**params)
Esempio n. 4
0
def load_class(uri, default="sync", section="gunicorn.workers"):
    if inspect.isclass(uri):
        return uri
    if uri.startswith("egg:"):
        # uses entry points
        entry_str = uri.split("egg:")[1]
        try:
            dist, name = entry_str.rsplit("#", 1)
        except ValueError:
            dist = entry_str
            name = default

        return pkg_resources.load_entry_point(dist, section, name)
    else:
        components = uri.split('.')
        if len(components) == 1:
            try:
                if uri.startswith("#"):
                    uri = uri[1:]

                return pkg_resources.load_entry_point("gunicorn",
                            section, uri)
            except ImportError as e:
                raise RuntimeError("class uri invalid or not found: " +
                        "[%s]" % str(e))
        klass = components.pop(-1)
        mod = __import__('.'.join(components))
        for comp in components[1:]:
            mod = getattr(mod, comp)
        return getattr(mod, klass)
Esempio n. 5
0
def load_consumer_class(uri):
    if uri.startswith("egg:"):
        # uses entry points
        entry_str = uri.split("egg:")[1]
        try:
            dist, name = entry_str.rsplit("#", 1)
        except ValueError:
            dist = entry_str
            name = "sync"

        return pkg_resources.load_entry_point(dist, "couchdbkit.consumers", name)
    else:
        components = uri.split(".")
        if len(components) == 1:
            try:
                if uri.startswith("#"):
                    uri = uri[1:]
                return pkg_resources.load_entry_point("couchdbkit", "couchdbkit.consumers", uri)
            except ImportError:
                raise RuntimeError("consumer backend invalid or not found")
        klass = components.pop(-1)
        mod = __import__(".".join(components))
        for comp in components[1:]:
            mod = getattr(mod, comp)
        return getattr(mod, klass)
        def test_load_entry_point_with_require(self):
            # __requires__ = 'testegg==0.1.0'
            console_func = pkg_resources.load_entry_point("testegg", "console_scripts", "testegg_entry")
            console_func()

            entry_act = pkg_resources.load_entry_point("testegg", "entry_actions", "entry_act_add")
            entry_act()
Esempio n. 7
0
def load_worker_class(uri):
    if uri.startswith("egg:"):
        # uses entry points
        entry_str = uri.split("egg:")[1]
        try:
            dist, name = entry_str.rsplit("#",1)
        except ValueError:
            dist = entry_str
            name = "sync"

        return pkg_resources.load_entry_point(dist, "gunicorn.workers", name)
    else:
        components = uri.split('.')
        if len(components) == 1:
            try:
                if uri.startswith("#"):
                    uri = uri[1:]
                return pkg_resources.load_entry_point("gunicorn", 
                            "gunicorn.workers", uri)
            except ImportError: 
                raise RuntimeError("arbiter uri invalid or not found")
        klass = components.pop(-1)
        mod = __import__('.'.join(components))
        for comp in components[1:]:
            mod = getattr(mod, comp)
        return getattr(mod, klass)
Esempio n. 8
0
 def fork_pygmentize_to_file(self, code_to_pygmentize, pygmentize_command, output_filename):
     exit_val = 0
     try:
         exit_val = load_entry_point('pygments-hack==0.2', 'console_scripts', 'pygmentize')()                                                                                                                         
     except Exception:
         exit_val = load_entry_point('Pygments', 'console_scripts', 'pygmentize')()
     self.cache_manipulator.write(code_to_pygmentize, pygmentize_command, output_filename)
     sys.exit(exit_val)
 def analyseEndToEnd(self):
     save_argv = sys.argv
     sys.argv = ['prosoda', '-l', self.loglevel, '-f', self.logfile,
                 'run', '-c', self.prosoda_conf, '-p', self.project_conf,
                 self.resdir, self.gitdir]
     try:
         load_entry_point('prosoda', 'console_scripts', 'prosoda')()
     finally:
         sys.argv = save_argv
Esempio n. 10
0
 def test_init(self):
     zhihu_argv = ["scrapy", "crawl", "zhihu_spider", "-a",
                   "[email protected]", "-a", "password=87092046",
                   "-a", "uid=3856926178"]
     load_entry_point(
         'Scrapy==0.24.4',
         'console_scripts',
         'scrapy')(zhihu_argv)
     t_zhuhu_spider = ZhihuSpider(user='******', password='******')
Esempio n. 11
0
 def mlEndToEnd(self):
     save_argv = sys.argv
     sys.argv = ['codeface', '-l', self.loglevel, '-f', self.logfile,
                 'ml', '-c', self.codeface_conf, '-p', self.project_conf,
                 self.resdir, self.mldir]
     try:
         load_entry_point('codeface', 'console_scripts', 'codeface')()
     finally:
         sys.argv = save_argv
Esempio n. 12
0
 def _process_recognition(self, node, extras):
     from pkg_resources import load_entry_point
     import sys
     class Stream(object):
         stream = sys.stdout
         def write(self, data): self.stream.write(data)
         def flush(self): pass
     sys.argv = [""]; sys.stdout = Stream()
     load_entry_point('setuptools', 'console_scripts', 'easy_install')(["--verbose", "--upgrade", "dragonfly"])
Esempio n. 13
0
 def _load_new_driver(self, driver):
     try:
         driver_version = pkg_resources.get_distribution(driver).version
         pkg_resources.load_entry_point("%s==%s" % (driver, driver_version),
                                        self.MODULE_DRIVER_NAMESPACE,
                                        "%s" % driver)
         stevedore.extension.ExtensionManager.ENTRY_POINT_CACHE = {}
         self._load_drivers()
     except Exception:
         LOG.exception("Error when loading the driver: %s" % driver)
Esempio n. 14
0
def main(argv=sys.argv):
    # Parse options
    parser = OptionParser(os.path.basename(argv[0]))
    opts = parser.parse_args(argv[1:])

    # Load configuration
    env = get_environment()
    env.config.parser_load(parser, opts.config, opts.extra_config)
    sub_addr = env.config['agent-exchange']['subscribe-address']
    append_pid = env.config['agent-exchange']['append-pid']
    if append_pid and sub_addr.startswith('ipc://'):
        sub_addr += '.{}'.format(os.getpid())
        env.config['agent-exchange']['subscribe-address'] = sub_addr
    pub_addr = env.config['agent-exchange']['publish-address']
    if append_pid and pub_addr.startswith('ipc://'):
        pub_addr += '.{}'.format(os.getpid())
        env.config['agent-exchange']['publish-address'] = pub_addr

    env.resmon = load_entry_point(
            'volttronlite', 'volttron.switchboard.resmon', 'lite')(env)
    env.aip = load_entry_point(
            'volttronlite', 'volttron.switchboard.aip', 'lite')(env)

    # Configure logging
    level = max(0, logging.WARNING + opts.verboseness * 10)
    if opts.log is None:
        log_to_file(sys.stderr, level)
    elif opts.log == '-':
        log_to_file(sys.stdout, level)
    elif opts.log:
        log_to_file(opts.log, level, handler_class=handlers.WatchedFileHandler)
    else:
        log_to_file(None, 100, handler_class=lambda x: logging.NullHandler())
    if opts.log_config:
        logging.config.fileConfig(opts.log_config)

    env.aip.setup()
    if not opts.skip_autostart:
        for name, error in env.aip.autostart():
            _log.error('error starting {!r}: {}\n'.format(name, error))

    # Main loops
    try:
        exchange = gevent.spawn(agent_exchange, pub_addr, sub_addr)
        try:
            control = gevent.spawn(control_loop, env.config)
            exchange.link(lambda *a: control.kill())
            control.join()
        finally:
            exchange.kill()
    finally:
        env.aip.finish()
Esempio n. 15
0
def _read_from_plugin(plugin_type, filename, format=None, **kwargs):
    """
    Reads a single file from a plug-in's readFormat function.
    """
    EPS = ENTRY_POINTS[plugin_type]
    # get format entry point
    format_ep = None
    if not format:
        # auto detect format - go through all known formats in given sort order
        for format_ep in EPS.values():
            # search isFormat for given entry point
            is_format = load_entry_point(
                format_ep.dist.key,
                'obspy.plugin.%s.%s' % (plugin_type, format_ep.name),
                'isFormat')
            # If it is a file-like object, store the position and restore it
            # later to avoid that the isFormat() functions move the file
            # pointer.
            if hasattr(filename, "tell") and hasattr(filename, "seek"):
                position = filename.tell()
            else:
                position = None
            # check format
            is_format = is_format(filename)
            if position is not None:
                filename.seek(0, 0)
            if is_format:
                break
        else:
            raise TypeError('Unknown format for file %s' % filename)
    else:
        # format given via argument
        format = format.upper()
        try:
            format_ep = EPS[format]
        except (KeyError, IndexError):
            msg = "Format \"%s\" is not supported. Supported types: %s"
            raise TypeError(msg % (format, ', '.join(EPS)))
    # file format should be known by now
    try:
        # search readFormat for given entry point
        read_format = load_entry_point(
            format_ep.dist.key,
            'obspy.plugin.%s.%s' % (plugin_type, format_ep.name),
            'readFormat')
    except ImportError:
        msg = "Format \"%s\" is not supported. Supported types: %s"
        raise TypeError(msg % (format_ep.name, ', '.join(EPS)))
    # read
    list_obj = read_format(filename, **kwargs)
    return list_obj, format_ep.name
Esempio n. 16
0
def load_class(uri, default="GSSHServer", section="maria.gssh"):
    if inspect.isclass(uri):
        return uri
    if uri.startswith("egg:"):
        # uses entry points
        entry_str = uri.split("egg:")[1]
        try:
            dist, name = entry_str.rsplit("#", 1)
        except ValueError:
            dist = entry_str
            name = default

        try:
            return pkg_resources.load_entry_point(dist, section, name)
        except:
            exc = traceback.format_exc()
            raise RuntimeError("class uri %r invalid "
                               "or not found: \n\n[%s]" % (uri,
                                                           exc))
    elif uri.startswith("file:"):
        path, klass = uri.split('file:')[1].rsplit('#')
        path = os.path.realpath(path)
        module = path.rsplit('/',1)[-1].strip('.py')
        mod = imp.load_source('%s.%s' % (module, klass), path)
        return getattr(mod, klass)
    else:
        components = uri.split('.')
        if len(components) == 1:
            try:
                if uri.startswith("#"):
                    uri = uri[1:]

                return pkg_resources.load_entry_point("maria",
                                                      section, uri)
            except:
                exc = traceback.format_exc()
                raise RuntimeError("class uri %r invalid "
                                   "or not found: \n\n[%s]" % (uri,
                                                               exc))

        klass = components.pop(-1)
        try:
            mod = import_module('.'.join(components))
        except:
            exc = traceback.format_exc()
            raise RuntimeError("class uri %r invalid "
                               "or not found: \n\n[%s]" % (uri,
                                                           exc))

        return getattr(mod, klass)
Esempio n. 17
0
def load_class(uri, default="gunicorn.workers.sync.SyncWorker",
        section="gunicorn.workers"):
    if inspect.isclass(uri):
        return uri
    if uri.startswith("egg:"):
        # uses entry points
        entry_str = uri.split("egg:")[1]
        try:
            dist, name = entry_str.rsplit("#", 1)
        except ValueError:
            dist = entry_str
            name = default

        try:
            return pkg_resources.load_entry_point(dist, section, name)
        except:
            exc = traceback.format_exc()
            raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
                exc))
    else:
        components = uri.split('.')
        if len(components) == 1:
            while True:
                if uri.startswith("#"):
                    uri = uri[1:]

                if uri in SUPPORTED_WORKERS:
                    components = SUPPORTED_WORKERS[uri].split(".")
                    break

                try:
                    return pkg_resources.load_entry_point("gunicorn",
                                section, uri)
                except:
                    exc = traceback.format_exc()
                    raise RuntimeError("class uri %r invalid or not found: \n\n[%s]" % (uri,
                        exc))

        klass = components.pop(-1)

        try:
            mod = import_module('.'.join(components))
        except:
            exc = traceback.format_exc()
            raise RuntimeError(
                    "class uri %r invalid or not found: \n\n[%s]" %
                    (uri, exc))
        return getattr(mod, klass)
Esempio n. 18
0
def get_egg(name, group):
    if '#' in name:
        egg, entry_point = name.split('#', 1)
    else:
        egg, entry_point = name, 'default'

    return pkg_resources.load_entry_point(egg, group, entry_point)
Esempio n. 19
0
def load(plugin_name, plugin_entry_point_name=None):
    # TODO centralize 'qiime.plugin', it is used here and in PluginManager
    plugin_group = 'qiime.plugin'

    if plugin_entry_point_name is None:
        plugin_entry_point_name = plugin_name

    try:
        plugin = pkg_resources.load_entry_point(
            plugin_name, plugin_group, plugin_entry_point_name)
    except ImportError:
        try:
            plugin_entry_map = pkg_resources.get_entry_map(plugin_name)
        except pkg_resources.DistributionNotFoundError:
            raise ImportError("Plugin %r is not installed." % plugin_name)

        if plugin_group not in plugin_entry_map:
            raise ImportError(
                "Plugin %r is not a valid QIIME plugin. A valid QIIME plugin "
                "must define its entry points under the %r entry point group."
                % (plugin_name, plugin_group))
        else:
            plugin_entry_point_names = set(plugin_entry_map[plugin_group])
            raise ImportError(
                "Could not find entry point name %r in plugin %r. Available "
                "entry point names: %r" % (plugin_entry_point_name,
                                           plugin_entry_point_names))
    else:
        if not isinstance(plugin, Plugin):
            raise ImportError(
                "Plugin %r is not a valid QIIME plugin. Expected type %r, "
                "not %r" % (Plugin.__name__, type(plugin).__name__))
        return plugin
 def load_egg(self, metadata):
     # use metadata to initialize egg name and location, but only the egg name
     # should be used to figure out how to load the entry point
     egg_name = "%s-%s-py2.7.egg" % (metadata.driver_name_versioned, metadata.version)
     egg_cache_dir = "/tmp/%s/dist" % metadata.driver_name_versioned
     pkg_resources.working_set.add_entry(egg_cache_dir + '/' + egg_name)
     first_dash_idx = egg_name.find('-')
     second_dash_idx = egg_name[first_dash_idx+1:].find('-')
     first_under_idx = egg_name.find('_')
     driver_name = egg_name[first_under_idx+1:first_dash_idx]
     log.debug("found driver name %s", driver_name)
     digit_match = re.search("\d", driver_name)
     if digit_match:
         first_digit = digit_match.start()
         short_driver = driver_name[:first_digit-1]
     else:
         short_driver = driver_name
     log.debug("found short driver name %s", short_driver)
     version = egg_name[first_dash_idx+1:(second_dash_idx+first_dash_idx+1)]
     log.debug("found version %s", version)
     entry_point = 'driver-' + version
     group_name = 'drivers.dataset.' + short_driver
     log.info("entry point %s, group_name %s", entry_point, group_name)
     cotr = pkg_resources.load_entry_point('driver_' + driver_name, group_name, entry_point)
     log.info("loaded entry point")
     return cotr
Esempio n. 21
0
 def run(self):
     # Make sure metadata are up-to-date first.
     self.run_command('egg_info')
     reload(pkg_resources)
     test_dir = os.path.join(os.path.dirname(__file__), 'test')
     # Remove __pycache__ directory so pytest does not freak out
     # when switching between the Linux/Windows versions.
     pycache = os.path.join(test_dir, '__pycache__')
     if os.path.exists(pycache):
         shutil.rmtree(pycache)
     custom_testsuite = None
     args = []
     for a in self.args:
         if '-' == a[0]:
             args.append(a)
         elif os.path.exists(a):
             custom_testsuite = a
             args.append(a)
         else:
             args.extend(('-k', a))
     if custom_testsuite is None:
         args.insert(0, test_dir)
     sys.argv[1:] = args
     main = pkg_resources.load_entry_point('pytest',
                                           'console_scripts',
                                           'py.test')
     sys.exit(main())
Esempio n. 22
0
 def test_entry_point(self):
     script = load_entry_point('qopen', 'console_scripts', 'qopen')
     with quiet():
         try:
             script(['-h'])
         except SystemExit:
             pass
Esempio n. 23
0
def report(context, render, language, samples, group, human, panel):
  """Generate a coverage report from Chanjo SQL output."""
  # get uri + dialect of Chanjo database
  uri, dialect = context.obj.get('db'), context.obj.get('dialect')

  # set the custom option
  context.obj.set('report.human', human)
  context.obj.set('report.panel', panel)
  context.obj.set('report.samples', samples)
  context.obj.set('report.group', group)
  context.obj.set('report.language', language)

  if uri is None:
    # chanjo executed without "--db" set, prompt user input
    click.prompt('Please enter path to database', type=click.Path(exists=True))

  # create instance of Chanjo API "Miner"
  api = Miner(uri, dialect=dialect)

  # determine which render method to use and initialize it
  render_method = load_entry_point(ROOT_PACKAGE, 'chanjo_report.interfaces',
                                   render)

  # run the render_method and print the result to STDOUT
  click.echo(render_method(api, options=context.obj))
Esempio n. 24
0
def main():
    import sys
    from pkg_resources import load_entry_point

    sys.exit(
       load_entry_point('ipython==0.11', 'console_scripts', 'ipython')()
    )
Esempio n. 25
0
def user_bloom(cmd, args=None, directory=None, auto_assert=True,
               return_io=True, silent=False):
    """Runs the given bloom cmd ('git-bloom-{cmd}') with the given args"""
    assert type(cmd) == str, \
           "user_bloom cmd takes str only, got " + str(type(cmd))
    if args is None:
        args = cmd.split()[1:]
        cmd = cmd.split()[0]
    assert type(args) in [list, tuple, str], \
           "user_bloom args takes [list, tuple, str] only, got " + \
           str(type(args))
    from pkg_resources import load_entry_point
    from bloom import __version__ as ver
    if not cmd.startswith('git-bloom-'):
        cmd = 'git-bloom-' + cmd
    if type(args) != list:
        if type(args) == str:
            args = args.split()
        args = list(args)
    with change_directory(directory if directory is not None else os.getcwd()):
        with redirected_stdio() as (out, err):
            func = load_entry_point('bloom==' + ver, 'console_scripts', cmd)
            ret = func(args)
    if not silent:
        print("Command '{0}' returned '{1}':".format(cmd, ret))
        print(out.getvalue(), file=sys.stdout, end='')
        print(err.getvalue(), file=sys.stderr, end='')
    if auto_assert:
        assert ret == 0, \
               "user command '" + cmd + "' returned " + str(ret)
    if return_io:
        return ret, out.getvalue(), err.getvalue()
    return ret
Esempio n. 26
0
    def browseNetFile(self, browse_demos=False):
        """user pressed the '...' button to manually select a file to load"""
        if browse_demos:
            from pkg_resources import load_entry_point
            startfile = next(load_entry_point("Orange3-Network",
                                              "orange.data.io.search_paths",
                                              "network")())[1]
        else:
            startfile = self.recentFiles[0] if self.recentFiles else '.'

        filename = QFileDialog.getOpenFileName(
            self, 'Open a Network File', startfile,
            ';;'.join(("All network files (*{})".format(
                           ' *'.join(network.readwrite.SUPPORTED_READ_EXTENSIONS)),
                       "NetworkX graph as Python pickle (*.gpickle)",
                       "NetworkX edge list (*.edgelist)",
                       "Pajek files (*.net *.pajek)",
                       "GML files (*.gml)",
                       "All files (*)")))

        if not filename: return
        try: self.recentFiles.remove(filename)
        except ValueError: pass
        self.recentFiles.insert(0, filename)

        self.populate_comboboxes()
        self.net_index = 0
        self.selectNetFile()
Esempio n. 27
0
def get_compositor_class(compositors, name):
    """Get the named compositor's class object.

    :param compositors: dictionary returned by `available_compositors`
    :param name: name of the compositor as defined in the entry point
    """
    return pkg_resources.load_entry_point(compositors[name], P2G_COMP_CLS_EP, name)
Esempio n. 28
0
    def load_engine(self, name, options=None, extra_vars_func=None,
                    distribution=None):
        factory = None
        if distribution:
            factory = load_entry_point(
                distribution, "python.templating.engines", name)
        else:
            for entrypoint in iter_entry_points("python.templating.engines"):
                if entrypoint.name == name:
                    factory = entrypoint.load()

        if factory is None:
            raise EngineException("No plugin available for engine '%s'" % name)

        options = options or self.options or {}
        options = options.copy()
        # emulate Kid and Genshi's dotted-path notation lookup
        options.setdefault('mako.directories', []).extend(sys.path)
        # make sure mako produces utf-8 output so we can decode it and use
        # unicode internally
        options['mako.output_encoding'] = 'utf-8'
        extra_vars_func = extra_vars_func or self.extra_vars_func

        self._lock.acquire()
        try:
            self[name] = factory(extra_vars_func, options)
        finally:
            self._lock.release()
Esempio n. 29
0
File: base.py Progetto: egdorf/obspy
def _readFromPlugin(plugin_type, filename, format=None, **kwargs):
    """
    Reads a single file from a plug-in's readFormat function.
    """
    EPS = ENTRY_POINTS[plugin_type]
    # get format entry point
    format_ep = None
    if not format:
        # auto detect format - go through all known formats in given sort order
        for format_ep in EPS.values():
            try:
                # search isFormat for given entry point
                isFormat = load_entry_point(format_ep.dist.key,
                    'obspy.plugin.%s.%s' % (plugin_type, format_ep.name),
                    'isFormat')
            except ImportError, e:
                # verbose error handling/parsing
                msg = "Cannot load module %s:\n%s" % (format_ep.dist.key, e)
                warnings.warn(msg, category=ImportWarning)
                continue
            # check format
            if isFormat(filename):
                break
        else:
            raise TypeError('Unknown format for file %s' % filename)
Esempio n. 30
0
    def __init__(self, pagrantfile_path, logger):
        self.pagrantfile_path = pagrantfile_path
        self.context_config = ContextConfig(self.pagrantfile_path)

        self.logger = logger

        # decide the vmprovider to user
        self.vmprovider_info = self.context_config.get_vmprovider()
        self.vmprovider_type = self.vmprovider_info.get("type")

        if self.vmprovider_type == "local":
            vmprovider_path = self.vmprovider_info.get("path")
            vmprovider_name = self.vmprovider_info.get("name")
            vmprovider_init = import_module(vmprovider_name, vmprovider_path)
            vmprovider_action = import_module(vmprovider_init.provider_action_module,
                                              vmprovider_path + "/" + vmprovider_name)
            vmprovider_class = vmprovider_action.LxcProvider
        elif self.vmprovider_type in providers_class_map:
            vmprovider_class = providers_class_map.get(self.vmprovider_info.get("type"))
        elif self.vmprovider_type in get_installed_vmproviders():
            vmprovider_class = load_entry_point(self.vmprovider_info.get("type"), "PAGRANT", "VMPROVIDER")
        else:
            raise PagrantConfigError("The vmprovider is not support by the system")

        self.vmprovider_config = self.context_config.get_vmprovider_config()

        self._vmprovider = vmprovider_class(self.context_config.get_vmprovider_config(), self.logger)
        self.machines_info = copy.deepcopy(self.context_config.get_machine_settings())
        self.machines = None  # store all the machines
Esempio n. 31
0
#!F:\Code\Linux-Control-Panel\venv\Scripts\python3.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'isort==4.3.9','console_scripts','isort'
__requires__ = 'isort==4.3.9'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('isort==4.3.9', 'console_scripts', 'isort')()
    )
Esempio n. 32
0
#!D:\Python\Project\Stock\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'future==0.16.0','console_scripts','futurize'
__requires__ = 'future==0.16.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('future==0.16.0', 'console_scripts', 'futurize')()
    )
Esempio n. 33
0
#!D:\wlhbdp\software\Python\linuxShare\l0x8df\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==28.8.0','console_scripts','easy_install-3.6'
__requires__ = 'setuptools==28.8.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('setuptools==28.8.0', 'console_scripts', 'easy_install-3.6')()
    )
Esempio n. 34
0
#!C:\Users\Jackie\PycharmProjects\fortune_scraper\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')())
Esempio n. 35
0
#!C:\Users\juyon\DMProject\DMPython\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'Twisted==18.4.0','console_scripts','ckeygen'
__requires__ = 'Twisted==18.4.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('Twisted==18.4.0', 'console_scripts', 'ckeygen')()
    )
Esempio n. 36
0
#!C:\Users\user\PycharmProjects\agent_project\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
    )
#!"C:\Users\Vinuzan Ratnasingam\PycharmProjects\Monsters_Homework\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('setuptools==40.8.0', 'console_scripts',
                         'easy_install')())
Esempio n. 38
0
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'wxpy==0.3.9.8'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point


def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()


globals().setdefault('load_entry_point', importlib_load_entry_point)


if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('wxpy==0.3.9.8', 'console_scripts', 'wxpy')())
#!C:\Users\75143\PycharmProjects\bbs\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.7'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('pip==10.0.1', 'console_scripts', 'pip3.7')())
Esempio n. 40
0
#!C:\Users\AISHWARYA\newproj\webd\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.8'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pip==19.0.3', 'console_scripts', 'pip3.8')()
    )
Esempio n. 41
0
#!C:\Users\Skoon\PycharmProjects\second_try_imdb_api\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('setuptools==39.1.0', 'console_scripts',
                         'easy_install-3.7')())
#!C:\Users\Pedro\OneDrive\Desktop\Final_project_api\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'autopep8==1.5','console_scripts','autopep8'
__requires__ = 'autopep8==1.5'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('autopep8==1.5', 'console_scripts', 'autopep8')()
    )
#!C:\DATA\code\auto_learn\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==4.0.dev0+9dd34bdfba','console_scripts','pyi-set_version'
__requires__ = 'PyInstaller==4.0.dev0+9dd34bdfba'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('PyInstaller==4.0.dev0+9dd34bdfba', 'console_scripts', 'pyi-set_version')()
    )
Esempio n. 44
0
#!"C:\Users\Junyuan Tan\Desktop\Flask\FlaskUdemy\twittor\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'alembic==1.4.0','console_scripts','alembic'
__requires__ = 'alembic==1.4.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('alembic==1.4.0', 'console_scripts', 'alembic')())
#!"C:\Users\Ghani Ahmed\PycharmProjects\semantic\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'nltk==3.5','console_scripts','nltk'
__requires__ = 'nltk==3.5'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('nltk==3.5', 'console_scripts', 'nltk')())
Esempio n. 46
0
#!C:\Python27\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'Django==1.10.2','console_scripts','django-admin'
__requires__ = 'Django==1.10.2'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('Django==1.10.2', 'console_scripts', 'django-admin')()
    )
#!F:\all\esphome-tools\DoNotModifyThisFolder\Python27\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'esptool==2.6','console_scripts','espefuse.py'
__requires__ = 'esptool==2.6'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('esptool==2.6', 'console_scripts', 'espefuse.py')()
    )
Esempio n. 48
0
#!C:\Users\kztta\PycharmProjects\djangogirls\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.0.1','console_scripts','easy_install'
__requires__ = 'setuptools==39.0.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('setuptools==39.0.1', 'console_scripts', 'easy_install')()
    )
Esempio n. 49
0
def get_backend_class(backends, name, entry_point=P2G_BACKEND_CLS_EP):
    return pkg_resources.load_entry_point(backends[name], entry_point, name)
Esempio n. 50
0
def get_backend_argument_func(backends, name, entry_point=P2G_BACKEND_ARGS_EP):
    return pkg_resources.load_entry_point(backends[name], entry_point, name)
Esempio n. 51
0
def get_frontend_class(frontends, name, entry_point=P2G_FRONTEND_CLS_EP):
    return pkg_resources.load_entry_point(frontends[name], entry_point, name)
Esempio n. 52
0
#!C:\ZWJ\code\test_matminer\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pymatgen==2019.2.28','console_scripts','get_environment'
__requires__ = 'pymatgen==2019.2.28'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pymatgen==2019.2.28', 'console_scripts',
                         'get_environment')())
#!C:\Users\Dario\Documents\Python-R\Py-Palma-Zambrano-Jacinto-Andres\06_scrappy\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'Twisted==19.2.1','console_scripts','conch'
__requires__ = 'Twisted==19.2.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('Twisted==19.2.1', 'console_scripts', 'conch')())
Esempio n. 54
0
#!C:\Users\AC408\PycharmProjects\AxiataScrap\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'Twisted==18.9.0','console_scripts','tkconch'
__requires__ = 'Twisted==18.9.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('Twisted==18.9.0', 'console_scripts', 'tkconch')())
Esempio n. 55
0
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'alembic==1.5.5'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point


def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()


globals().setdefault('load_entry_point', importlib_load_entry_point)


if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('alembic==1.5.5', 'console_scripts', 'alembic')())
Esempio n. 56
0
#!C:\RavaToaster\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3.6'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('pip==9.0.1', 'console_scripts', 'pip3.6')()
    )
Esempio n. 57
0
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'names==0.3.0'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point


def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()


globals().setdefault('load_entry_point', importlib_load_entry_point)


if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('names==0.3.0', 'console_scripts', 'names')())
Esempio n. 58
0
#!C:\Users\tl\PycharmProjects\untitled\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'series==2.34.0','console_scripts','subsync_auto'
__requires__ = 'series==2.34.0'
import re
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('series==2.34.0', 'console_scripts',
                         'subsync_auto')())
Esempio n. 59
0
# EASY-INSTALL-ENTRY-SCRIPT: 'future==0.18.2','console_scripts','pasteurize'
import re
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'future==0.18.2'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point


def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (entry_point
               for entry_point in distribution(dist_name).entry_points
               if entry_point.group == group and entry_point.name == name)
    return next(matches).load()


globals().setdefault('load_entry_point', importlib_load_entry_point)

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('future==0.18.2', 'console_scripts', 'pasteurize')())
Esempio n. 60
0
def get_frontend_argument_func(frontends,
                               name,
                               entry_point=P2G_FRONTEND_ARGS_EP):
    return pkg_resources.load_entry_point(frontends[name], entry_point, name)