Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (18 sloc) 992 Bytes
#!/usr/bin/env python
import optparse
p = optparse.OptionParser()
p.add_option("--server-hostname", dest="hostname", type="string")
(opts,args) = p.parse_args()
if (type(opts.hostname) == str and opts.hostname.startswith("stage")):
# The first step of setting up site/ for publishing in a staging
# environment is substituting staging URLs for production
for path in ["index.html", "jsapi/include.js", "jsapi/trusted.js"]:
file_contents = ""
with open(path, "r") as fp:
file_contents =
file_contents = file_contents.replace("//","//")
# We'll replace the "get demo apps" link which points to in
# production with a pointer to a staging version of the demo appstore
file_contents = file_contents.replace("//","//")
with open(path, "w+") as fp:
Jump to Line
Something went wrong with that request. Please try again.