Commit 54a47bce 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 b21f1895
...@@ -113,6 +113,12 @@ exec %(zdctl)s -C "$INSTANCE/etc/%(package)sctl.conf" ${1+"$@"} ...@@ -113,6 +113,12 @@ exec %(zdctl)s -C "$INSTANCE/etc/%(package)sctl.conf" ${1+"$@"}
""" """
def main(): def main():
ZEOInstanceBuilder().run()
print "All done."
class ZEOInstanceBuilder:
def run(self):
try: try:
opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
except getopt.error, msg: except getopt.error, msg:
...@@ -135,7 +141,11 @@ def main(): ...@@ -135,7 +141,11 @@ def main():
else: else:
port = 9999 port = 9999
checkport(port) checkport(port)
params = { params = self.get_params(home, port)
self.create(home, params)
def get_params(self, home, port):
return {
"package": "zeo", "package": "zeo",
"PACKAGE": "ZEO", "PACKAGE": "ZEO",
"home": home, "home": home,
...@@ -145,6 +155,8 @@ def main(): ...@@ -145,6 +155,8 @@ def main():
"zdrun": which("zdrun.py"), "zdrun": which("zdrun.py"),
"zdctl": which("zdctl.py"), "zdctl": which("zdctl.py"),
} }
def create(self, home, params):
makedir(home) makedir(home)
makedir(home, "etc") makedir(home, "etc")
makedir(home, "var") makedir(home, "var")
...@@ -153,7 +165,7 @@ def main(): ...@@ -153,7 +165,7 @@ def main():
makefile(zeo_conf_template, home, "etc", "zeo.conf", **params) makefile(zeo_conf_template, home, "etc", "zeo.conf", **params)
makefile(runner_conf_template, home, "etc", "zeoctl.conf", **params) makefile(runner_conf_template, home, "etc", "zeoctl.conf", **params)
makexfile(zdctl_template, home, "bin", "zeoctl", **params) makexfile(zdctl_template, home, "bin", "zeoctl", **params)
print "All done."
def checkport(port): def checkport(port):
import socket 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