Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for key, value in pairs:
if key in os.environ:
self._export('%s%s' % (self._old_prefix, key), os.environ[key])
self._export(key, value)
def _export(self, key, value):
self._exported.append(key)
self._source_lines.append('export %s=%s' % (key, value))
def _unset(self, key):
self._source_lines.append('unset %s' % key)
loader = Loader()
def pre_activate(args):
project = args[0]
base = os.environ.get('PROJECT_HOME', os.environ.get('WORKON_HOME'))
loader.load(os.path.join(base, project, '.env'))
def pre_activate_source(args):
return loader.source()
def post_deactivate(args):
loader.clear()