forked from sumpfork/dominiontabs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_release.py
41 lines (34 loc) · 1.03 KB
/
do_release.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
36
37
38
39
40
41
import domdiv
import domdiv.main
from zipfile import ZipFile, ZIP_DEFLATED
prefix = "generated/sumpfork_dominion_tabs_"
postfix = "v" + domdiv.__version__ + ".pdf"
def doit(args, main):
args = args + " --outfile " + prefix + main + postfix
args = args.split()
fname = args[-1]
print(args)
print(":::Generating " + fname)
options = domdiv.main.parse_opts(args)
options = domdiv.main.clean_opts(options)
domdiv.main.generate(options)
return fname
argsets = [
("", ""),
("--orientation=vertical", "vertical_"),
("--papersize=A4", "A4_"),
("--papersize=A4 --orientation=vertical", "vertical_A4_"),
("--size=sleeved", "sleeved_"),
("--size=sleeved --orientation=vertical", "vertical_sleeved_"),
]
additional = ["--expansion-dividers"]
fnames = [doit(args[0] + " " + " ".join(additional), args[1]) for args in argsets]
print(fnames)
zip = ZipFile(
"generated/sumpfork_dominion_tabs_v" + domdiv.__version__ + ".zip",
"w",
ZIP_DEFLATED,
)
for f in fnames:
zip.write(f)
zip.close()