This repository has been archived by the owner on Jan 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
gen.py
executable file
·67 lines (51 loc) · 2.12 KB
/
gen.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import datetime
import fileinput
from utils import RSYNC_PATH, FORUM_URL, get_version, get_tag_url
from doc_generator import find_pkg, repl_all
def usage():
print "gen.py version build"
sys.exit(1)
try:
version = sys.argv[1]
build = sys.argv[2]
except:
usage()
repl = {"@VERSION@": version,
"@BUILD@": build,
"@MONTHYEAR@": datetime.datetime.now().strftime("%b %Y"),
"@YEAR@": datetime.datetime.now().strftime("%Y")}
major_version, minor_version = get_version(version)
repl["@TAG_URL@"] = get_tag_url("openmicroscopy", version)
repl["@DOC_URL@"] = "http://www.openmicroscopy.org/site/support/omero%s.%s" \
% (major_version, minor_version)
repl["@HELP_URL@"] = "http://help.openmicroscopy.org/getting-started-%s.html"\
% major_version
PREFIX = os.environ.get('PREFIX', 'omero')
DOWNLOADS_PATH = '%s/%s/%s/' % (RSYNC_PATH, PREFIX, version)
repl["@ANNOUNCEMENT_URL@"] = os.environ.get('ANNOUNCEMENT_URL', FORUM_URL)
repl["@MILESTONE@"] = os.environ.get('MILESTONE', "OMERO-%s" % version)
for x, y in (
("LINUX_INSIGHT",
"artifacts/OMERO.insight-@VERSION@-ice36-@[email protected]"),
("MAC_INSIGHT",
"artifacts/OMERO.insight-@VERSION@-ice36-@[email protected]"),
("WIN_INSIGHT",
"artifacts/OMERO.insight-@VERSION@-ice36-@[email protected]"),
("IJ_CLIENTS",
"artifacts/OMERO.insight-ij-@VERSION@-ice36-@[email protected]"),
("MATLAB_CLIENTS",
"artifacts/OMERO.matlab-@VERSION@-ice36-@[email protected]"),
("SERVER36", "artifacts/OMERO.server-@VERSION@-ice36-@[email protected]"),
("PYTHON36", "artifacts/OMERO.py-@VERSION@-ice36-@[email protected]"),
("JAVA36", "artifacts/OMERO.java-@VERSION@-ice36-@[email protected]"),
("DOCS", "artifacts/OMERO.apidoc-@VERSION@-ice36-@[email protected]"),
("DOC", "artifacts/OMERO.doc-@[email protected]"),
("SOURCE_CODE", "artifacts/openmicroscopy-@[email protected]"),
):
find_pkg(repl, DOWNLOADS_PATH, x, y)
for line in fileinput.input(["omero_downloads.html"]):
print repl_all(repl, line, check_http=True),