diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-12 08:10:42 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-12 08:24:06 +0200 |
commit | 466fcd268e53743ca7414f1fe969a74cd0ac1ee1 (patch) | |
tree | 18056390e7f507c1f40b38edfaa4c218b840f0e7 /with | |
parent | 2a562fd5a7d935d3743f6746927236b40f891a5c (diff) | |
download | extrautils-466fcd268e53743ca7414f1fe969a74cd0ac1ee1.tar.gz |
drop old crap
Diffstat (limited to 'with')
-rwxr-xr-x | with | 35 |
1 files changed, 0 insertions, 35 deletions
@@ -1,35 +0,0 @@ -#!/usr/bin/python3 - - -import os - - -import cliapp -import yaml - - -class With(cliapp.Application): - - def add_settings(self): - self.settings.string( - ['env-file', 'e'], - 'read environment description from FILE', - metavar='FILE', - default=os.path.expanduser('~/.config/with-envs/environments.yaml')) - - def process_args(self, args): - env_name = args[0] - argv = args[1:] - - envs = self.get_environments() - print(envs) - env = dict(os.environ) - env.update(envs[env_name]) - cliapp.runcmd(argv, env=env, stdout=None, stderr=None) - - def get_environments(self): - filename = self.settings['env-file'] - return yaml.safe_load(open(filename)) - - -With().run() |