-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_bates.py
35 lines (29 loc) · 1.3 KB
/
run_bates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import argparse
from bates import bates
def main():
parser = argparse.ArgumentParser(
description='Change string prefix of Bates number')
parser.add_argument('dirname', type=str,
help='directory with the unstamped files')
parser.add_argument('output-dir', help='directory for stamped documents',
type=str)
parser.add_argument('--prefix', type=str,
help='string prefix for the Bates number', default='')
parser.add_argument('--x', help='horizontal position of text', type=int,
default=300)
parser.add_argument('--y', help='vertical position of text', type=int,
default=30)
parser.add_argument('--rotation', help='rotation of the text', type=int,
default=0)
parser.add_argument('--no-manual',
help='whether to manually set the text position.'
'True if called, false otherwise',
action='store_true')
args = parser.parse_args()
if args.no_manual:
manual = False
else:
manual = True
bates.bates(dirname=args.dirname, prefix=args.prefix, x=args.x, y=args.y,
rotation=args.rotation, manual=manual, output_dir=args.output_dir)
main()