import optparse
import time
+import xmlrpclib
import accounts
import api
import database
import delegate
import logger
-import plc
import sliver_vs
import tools
parser.add_option('-s', '--startup', action='store_true', dest='startup', default=False, help='run all sliver startup scripts')
(options, args) = parser.parse_args()
+# XXX - awaiting a real implementation
+data = []
+modules = []
+
+def GetSlivers():
+ for mod in modules: mod.GetSlivers_callback(data)
+
+def start_and_register_callback(mod):
+ mod.start()
+ modules.append(mod)
+
+
def run():
try:
if options.daemon: tools.daemon()
other_pid = tools.pid_file()
if other_pid != None:
- print """There might be another instance of the node manager running as pid %d. If this is not the case, please remove the pid file %s""" % (other_pid, PID_FILE)
+ print """There might be another instance of the node manager running as pid %d. If this is not the case, please remove the pid file %s""" % (other_pid, tools.PID_FILE)
return
- database.start()
+ start_and_register_callback(database)
api.start()
while True:
try: plc.fetch_and_update()