43 |
43 |
44 def usage(): |
44 def usage(): |
45 print(""" |
45 print(""" |
46 Usage of Beremiz PLC execution service :\n |
46 Usage of Beremiz PLC execution service :\n |
47 %s {[-n servicename] [-i IP] [-p port] [-x enabletaskbar] [-a autostart]|-h|--help} working_dir |
47 %s {[-n servicename] [-i IP] [-p port] [-x enabletaskbar] [-a autostart]|-h|--help} working_dir |
48 -n - zeroconf service name (default:disabled) |
48 -n zeroconf service name (default:disabled) |
49 -i - IP address of interface to bind to (default:localhost) |
49 -i IP address of interface to bind to (default:localhost) |
50 -p - port number default:3000 |
50 -p port number default:3000 |
51 -h - print this help text and quit |
51 -h print this help text and quit |
52 -a - autostart PLC (0:disable 1:enable) (default:0) |
52 -a autostart PLC (0:disable 1:enable) (default:0) |
53 -x - enable/disable wxTaskbarIcon (0:disable 1:enable) (default:1) |
53 -x enable/disable wxTaskbarIcon (0:disable 1:enable) (default:1) |
54 -t - enable/disable Twisted web interface (0:disable 1:enable) (default:1) |
54 -t enable/disable Twisted web interface (0:disable 1:enable) (default:1) |
55 -w - web server port or "off" to disable web server (default:8009) |
55 -w web server port or "off" to disable web server (default:8009) |
56 -c - WAMP client default config file (default:wampconf.json) |
56 -c WAMP client config file (can be overriden by wampconf.json in project) |
57 -s - WAMP client secret, given as a file |
57 -s WAMP client secret, given as a file (can be overriden by wamp.secret in project) |
58 -e - python extension (absolute path .py) |
58 -e python extension (absolute path .py) |
59 |
59 |
60 working_dir - directory where are stored PLC files |
60 working_dir - directory where are stored PLC files |
61 """ % sys.argv[0]) |
61 """ % sys.argv[0]) |
62 |
62 |
63 |
63 |
614 LogMessageAndException(_("Nevow Web service failed. ")) |
614 LogMessageAndException(_("Nevow Web service failed. ")) |
615 |
615 |
616 try: |
616 try: |
617 WC.SetServer(pyroserver) |
617 WC.SetServer(pyroserver) |
618 WC.RegisterWampClient(wampconf, wampsecret) |
618 WC.RegisterWampClient(wampconf, wampsecret) |
|
619 WC.RegisterWebSettings(NS) |
619 except Exception: |
620 except Exception: |
620 LogMessageAndException(_("WAMP client startup failed. ")) |
621 LogMessageAndException(_("WAMP client startup failed. ")) |
621 |
622 |
622 pyro_thread_started = Lock() |
623 pyro_thread_started = Lock() |
623 pyro_thread_started.acquire() |
624 pyro_thread_started.acquire() |