diff options
author | Aaron LI <aly@aaronly.me> | 2017-08-16 23:31:23 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-08-16 23:31:23 +0800 |
commit | e185edd294a1ff22c112c29e45e7eec0e6fa76cb (patch) | |
tree | a7e23145ed48a285740db549090691ed21667509 /bin | |
parent | 3c4f53ef53d9a95c51bdec851f586774827a2eac (diff) | |
download | chandra-acis-analysis-e185edd294a1ff22c112c29e45e7eec0e6fa76cb.tar.bz2 |
update_manifest.py: Add argument --add-directory with a new function
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update_manifest.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/update_manifest.py b/bin/update_manifest.py index 44ccb94..0bc41e0 100755 --- a/bin/update_manifest.py +++ b/bin/update_manifest.py @@ -33,6 +33,15 @@ def get_path(pglob, pdir=None): return p +def add_directory(manifest): + """ + Add the directory where this manifest file locates as the item + ``directory`` into the manifest. + """ + directory = os.path.dirname(manifest.filepath) + manifest.set("directory", directory) + + def add_repro(reprodir, manifest): """ Add the generated products by ``chandra_repro`` to the manifest. @@ -60,6 +69,10 @@ def main(): action="store_true", help="create '%s' under current " % manifestfile + "working directory if not exists") + parser.add_argument("-D", "--add-directory", dest="add_directory", + action="store_true", + help="add an 'directory' item to the manifest " + + "storing the directory where the manifest locates") parser.add_argument("-r", "--repro", dest="reprodir", default=None, help="path to the repro directory; add the " + "reprocessed products to manifest if specified") |