How to use the pin.event.eventhook function in pin

To help you get started, we’ve selected a few pin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dustinlacewell / pin / pin / plugins / autovenv.py View on Github external
    @eventhook('init-post-script')
    def activate_capn(self, file):
        if self.active:
            file.write("source capn\n")
if CAPN:
github dustinlacewell / pin / pin / plugins / autovenv.py View on Github external
    @eventhook('venv-post-create')
    def install(self, path, **kwargs):
        if self.active:
            activate_path = os.path.join(path, 'bin', 'activate')
            add_external_hook(self.default_hook_file, os.getcwd(), hooktype='tree',
                          enter=['source %s' % activate_path],
                          exit=['deactivate'], unique=True)
github dustinlacewell / pin / pin / plugins / venv.py View on Github external
    @eventhook('init-post-exec')
    def create_venv(self, path, **kwargs):
        if self.options and self.options.venv:
            print "Creating virtualenv..."
            path = os.path.join(path, '.pin', 'env')
            self.fire("pre-create", path)
            create_virtualenv(path)
            self.fire("post-create", path)
github dustinlacewell / pin / pin / plugins / venv.py View on Github external
    @eventhook('init-post-args')
    def parse_args(self, args, **kwargs):
        parser = ArgumentParser()
        parser.add_argument('--venv', action='store_true')
        self.options, extargs  = parser.parse_known_args(args)
github dustinlacewell / pin / pin / plugins / autovenv.py View on Github external
    @eventhook('init-post-args')
    def postargs(self, args):
        parser = ArgumentParser()
        parser.add_argument('--autoenv', action='store_true')
        parser.add_argument('--venv', action='store_true')
        self.options, extargs = parser.parse_known_args(args)