forked from ome/ome-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiguregen.py
40 lines (27 loc) · 871 Bytes
/
figuregen.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import fileinput
from utils import RSYNC_PATH
from doc_generator import find_pkg, repl_all
def usage():
print "figuregen.py version"
sys.exit(1)
try:
version = sys.argv[1]
except:
usage()
repl = {"@VERSION@": version,
"@MONTHYEAR@": datetime.datetime.now().strftime("%b %Y")}
PREFIX = os.environ.get('PREFIX', 'figure')
FIGURE_RSYNC_PATH = '%s/%s/%s/' % (RSYNC_PATH, PREFIX, version)
forum_url = "https://www.openmicroscopy.org/community/viewforum.php?f=11"
repl["@ANNOUNCEMENT_URL@"] = os.environ.get('ANNOUNCEMENT_URL', forum_url)
for x, y in (
("FIGURE", "figure-@[email protected]"),
):
find_pkg(repl, FIGURE_RSYNC_PATH, x, y)
for line in fileinput.input(["figure_downloads.html"]):
print repl_all(repl, line, check_http=True),