aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-08-20 15:00:45 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-08-20 15:00:45 -0700
commit1c8a828dbe87d5adf6a0f528fe9f0e07ee32fa68 (patch)
tree103b1e998201119afee1e900cd130b7fac66b087
parent8b50c4516a6e53c9d6f06207a0c636f9348967e2 (diff)
fix: allow manual override for tmp directory number
-rw-r--r--pangraph/build.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/pangraph/build.py b/pangraph/build.py
index e744149..8cbfa1d 100644
--- a/pangraph/build.py
+++ b/pangraph/build.py
@@ -52,6 +52,10 @@ def register_args(parser):
default=False,
action='store_true',
help="boolean flag that toggles whether the graph statistics are computed for intermediate graphs")
+ parser.add_argument("-n", "--tmp-dir-num",
+ type=int,
+ default=-1,
+ help="manually sets the tmp directory number. internal use only.")
parser.add_argument("input",
type=str,
default="-",
@@ -74,10 +78,13 @@ def main(args):
root = args.dir.rstrip('/')
tmp = f"{root}/tmp"
- i = 0
- while os.path.isdir(tmp) and i < 32:
- i += 1
- tmp = f"{root}/tmp{i:03d}"
+ if args.n == -1:
+ i = 0
+ while os.path.isdir(tmp) and i < 64:
+ i += 1
+ tmp = f"{root}/tmp{i:03d}"
+ else:
+ tmp = f"{root}/tmp{args.n:03d}"
mkdir(tmp)
log("aligning")