Skip to content
Snippets Groups Projects
Commit d656efac authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

mkexp: added 'editexp' tool to edit the config file for a given 'update' script

parent b8d3aa7f
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ Global
------
* Added 'getconfig' tool to generate clean config files from 'update' scripts
* Added 'editres' tool to edit the config file for a given 'update' script
Templates
---------
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
No preview for this file type
editexp 0 → 100755
#! /usr/bin/env python
#
# Edit experiment config for given update file
#
# $Id$
#
import argparse
import os
import update
from feedback import die
import package_info
#
# Main routine
#
# Check command line
command_line = argparse.ArgumentParser(description=
'Edit experiment config for given update file')
command_line.add_argument('update', nargs='?', default='update',
help='update script file name [%(default)s]')
command_line.add_argument('-V', '--version', action='version',
version=package_info.version)
args = command_line.parse_args()
try:
update_data = update.Update(args.update)
editor = os.environ.get('VISUAL', os.environ.get('EDITOR', 'vi'))
os.execlp(editor, editor, update_data.get_config_file())
except IOError as error:
die("'{0}': {1}".format(error.filename, error.strerror))
......@@ -10,7 +10,7 @@ setup(
author_email = 'karl-hermann.wieners@mpimet.mpg.de',
url = 'http://code.mpimet.mpg.de/projects/esmenv',
py_modules = ['_version', 'configobj', 'validate', 'feedback', 'expargparse', 'expconfig', 'files', 'package_info', 'update'],
scripts = ['mkexp', 'getexp', 'rmexp', 'diffexp', 'diffpath', 'cpexp', 'cppath', 'duexp', 'getconfig'],
scripts = ['mkexp', 'getexp', 'rmexp', 'diffexp', 'diffpath', 'cpexp', 'cppath', 'duexp', 'getconfig', 'editexp'],
data_files = [('share/doc/'+package_info.name, ['doc/mkexp.pdf', 'mkexp.bash'])],
platforms = ['Posix'],
license = 'LICENSE.txt',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment