Commit 8f9d3e14 authored by Fred Drake's avatar Fred Drake

Turn some of this into an object so it can be extended (slightly).

It may be reasonable to change this more, but the benefits aren't clear.
(These changes will be used from the new-install-branch.)
parent f59812a4
......@@ -113,6 +113,12 @@ exec %(zdctl)s -C "$INSTANCE/etc/%(package)sctl.conf" ${1+"$@"}
"""
def main():
ZEOInstanceBuilder().run()
print "All done."
class ZEOInstanceBuilder:
def run(self):
try:
opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
except getopt.error, msg:
......@@ -135,7 +141,11 @@ def main():
else:
port = 9999
checkport(port)
params = {
params = self.get_params(home, port)
self.create(home, params)
def get_params(self, home, port):
return {
"package": "zeo",
"PACKAGE": "ZEO",
"home": home,
......@@ -145,6 +155,8 @@ def main():
"zdrun": which("zdrun.py"),
"zdctl": which("zdctl.py"),
}
def create(self, home, params):
makedir(home)
makedir(home, "etc")
makedir(home, "var")
......@@ -153,7 +165,7 @@ def main():
makefile(zeo_conf_template, home, "etc", "zeo.conf", **params)
makefile(runner_conf_template, home, "etc", "zeoctl.conf", **params)
makexfile(zdctl_template, home, "bin", "zeoctl", **params)
print "All done."
def checkport(port):
import socket
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment