Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
7b32e386
Commit
7b32e386
authored
6 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
mkexp: added example script 'share/doc/mkexp/mkexp.bash' with 'bash' shell utilities
parent
163a2e86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGES.txt
+1
-0
1 addition, 0 deletions
CHANGES.txt
getexp
+4
-1
4 additions, 1 deletion
getexp
mkexp.bash
+40
-0
40 additions, 0 deletions
mkexp.bash
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
46 additions
and
2 deletions
CHANGES.txt
+
1
−
0
View file @
7b32e386
...
...
@@ -17,6 +17,7 @@ Global
* Changed merge of process environment ('DEFAULT' section) to be sorted
* Added tool 'duexp' to show disk usage by the given experiment
* Added 'key' option to getexp for querying a specific config value
* Added example script 'share/doc/mkexp/mkexp.bash' with 'bash' shell utilities
Release 1.0.0
=============
...
...
This diff is collapsed.
Click to expand it.
getexp
+
4
−
1
View file @
7b32e386
...
...
@@ -101,7 +101,10 @@ except ExpConfigError as error:
if
args
.
readme
:
print
(
config
[
'
EXP_DESCRIPTION
'
])
elif
args
.
key
:
print
(
get_value
(
config
,
args
.
key
));
try
:
print
(
get_value
(
config
,
args
.
key
));
except
KeyError
as
error
:
die
(
"
invalid config name
'
{0}
'"
.
format
(
error
.
message
))
elif
args
.
verbose
>=
2
:
config
.
indent_type
=
'
'
config
.
write
(
sys
.
stdout
)
...
...
This diff is collapsed.
Click to expand it.
mkexp.bash
0 → 100644
+
40
−
0
View file @
7b32e386
#
# Source this file for MakeExperiments! bash utilities
#
# Change to script directory ($SCRIPT_DIR) of a given .config.
# If no .config file is given, the 'update' file is sought and evaluated.
# '-d xxx' will change to $XXX_DIR instead of $SCRIPT_DIR
cdexp
()
{
local
var
=
script
dir
cfg buffer vardir OPTIND
while
getopts
:d:h OPTOPT
do
case
$OPTOPT
in
d
)
var
=
"
$OPTARG
"
;;
h
)
exec
>
&2
echo
"Usage: cdexp [-d DIRSPEC] [-h] [CONFIG]"
echo
echo
"DIRSPEC is converted to upper case and '_DIR' is added"
echo
"If CONFIG is omitted, the 'update' file must be available"
return
0
;;
\?
)
echo
"Oops: invalid option '
$OPTARG
'"
>
&2
;
return
1
;;
esac
done
shift
$((
OPTIND
-
1
))
if
[[
"
$1
"
]]
then
dir
=
$(
dirname
"
$1
"
)
cfg
=
"
$1
"
elif
[[
-f
update
]]
then
eval
$(
awk
'/^cd / {dir=$2; print "dir=" dir ";"}; /^exec / {print "cfg=" dir "/" $3}'
update
)
else
echo
'Oops: invalid number of parameters'
>
&2
return
1
fi
vardir
=
$(
getexp
-p
"
$dir
"
-k
"
${
var
^^
}
_DIR"
"
$cfg
"
)
&&
cd
"
$vardir
"
}
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
7b32e386
...
...
@@ -11,7 +11,7 @@ setup(
url
=
'
http://code.mpimet.mpg.de/projects/esmenv
'
,
py_modules
=
[
'
configobj
'
,
'
validate
'
,
'
feedback
'
,
'
expconfig
'
,
'
files
'
,
'
package_info
'
],
scripts
=
[
'
mkexp
'
,
'
getexp
'
,
'
rmexp
'
,
'
diffexp
'
,
'
diffpath
'
,
'
cpexp
'
,
'
cppath
'
],
data_files
=
[(
'
share/doc/
'
+
package_info
.
name
,
[
'
doc/mkexp.pdf
'
])],
data_files
=
[(
'
share/doc/
'
+
package_info
.
name
,
[
'
doc/mkexp.pdf
'
,
'
mkexp.bash
'
])],
platforms
=
[
'
Posix
'
],
license
=
'
LICENSE.txt
'
,
requires
=
[
'
Jinja2(>= 2.6)
'
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment