--- a/Beremiz_service.py Thu Aug 21 17:17:36 2008 +0200
+++ b/Beremiz_service.py Thu Aug 21 17:18:44 2008 +0200
@@ -35,7 +35,7 @@
- opts, args = getopt.getopt(sys.argv[1:], "a:d:p:h", ["directory=", "port=", "help"])
+ opts, args = getopt.getopt(sys.argv[1:], "a:p:h", ["help"]) except getopt.GetoptError, err:
# print help information and exit:
print str(err) # will print something like "option -a not recognized"
@@ -43,10 +43,9 @@
-WorkingDir = os.getcwd()
if o in ("-h", "--help"):
@@ -54,9 +53,6 @@
elif o in ("-a", "--address"):
if len(a.split(".")) == 4 or a == "localhost":
- elif o in ("-d", "--directory"):
- # overwrite default working directory
elif o in ("-p", "--port"):
# port: port that the service runs on
@@ -64,6 +60,17 @@
+ WorkingDir = os.getcwd() from runtime import PLCObject, ServicePublisher
@@ -93,7 +100,7 @@
daemon=pyro.Daemon(host=ip, port=port)
-uri = daemon.connect(PLCObject(WorkingDir, daemon),"PLCObject")
+uri = daemon.connect(PLCObject(WorkingDir, daemon, args),"PLCObject") print "The daemon runs on port :",daemon.port
print "The object's uri is :",uri