Rename
diff --git a/jintest.py b/jintest.py
deleted file mode 100755
index 2d743a9..0000000
--- a/jintest.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-
-import time
-import signal
-from copy import copy
-
-import xmlserialize as xml
-import discovery
-from templates import do_render
-from configtemplate import read_template
-
-def on_sigint(signum, frame):
- print "Got SIGINT"
- browser.ml.stop()
- browser.stop()
-
-signal.signal(signal.SIGINT, on_sigint)
-
-class Service(object):
- def __init__(self):
- self.ip = ''
- self.port = 0
- self.proto = ''
- self.stype = ''
- self.name = ''
-
- def uri(self):
- if self.port:
- return "%s:%s" % (self.ip, self.port)
- else:
- return self.ip
-
- def __repr__(self):
- return "<Service %s on %s:%s>" % (self.name,self.ip,self.port)
-
-class Host(object):
- def __init__(self):
- self.ip = ''
- self.hostname = ''
-
-class ZeroconfListener(object):
- def new_service(self, iface,proto,name,stype,domain, host, aproto,addr, port, txt,flags):
- global services
- sname = discovery.servicenames[stype]
- svc = Service()
- svc.name = name
- svc.ip = addr
- svc.port = port
- services[sname] = svc
- print "services[%s] = %s" % (sname, svc)
-
-listener = ZeroconfListener()
-browser = discovery.Browser(args=('_ssh._tcp','_pulse-server._tcp','_nameserver._udp'))
-browser.set_listener(listener)
-browser.start()
-
-services = {}
-services['proxy'] = Service()
-services['proxy'].ip = '192.168.32.3'
-services['proxy'].port = 3128
-services['gateway'] = Service()
-services['gateway'].ip = '192.168.32.1'
-
-machine = Host()
-machine.ip = '192.168.1.2'
-machine.hostname = 'portnov'
-
-time.sleep(5)
-
-system = read_template('configs/templates/system.xml')
-scfg = system(proxy='{{services.proxy.uri}}')
-print "First config:"
-print do_render(scfg)
-
-ncfg = scfg(dns='{{services.dns.ip}}')
-print "Second config:"
-print do_render(ncfg)
-
diff --git a/test.py b/test.py
new file mode 100755
index 0000000..2d743a9
--- /dev/null
+++ b/test.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+import time
+import signal
+from copy import copy
+
+import xmlserialize as xml
+import discovery
+from templates import do_render
+from configtemplate import read_template
+
+def on_sigint(signum, frame):
+ print "Got SIGINT"
+ browser.ml.stop()
+ browser.stop()
+
+signal.signal(signal.SIGINT, on_sigint)
+
+class Service(object):
+ def __init__(self):
+ self.ip = ''
+ self.port = 0
+ self.proto = ''
+ self.stype = ''
+ self.name = ''
+
+ def uri(self):
+ if self.port:
+ return "%s:%s" % (self.ip, self.port)
+ else:
+ return self.ip
+
+ def __repr__(self):
+ return "<Service %s on %s:%s>" % (self.name,self.ip,self.port)
+
+class Host(object):
+ def __init__(self):
+ self.ip = ''
+ self.hostname = ''
+
+class ZeroconfListener(object):
+ def new_service(self, iface,proto,name,stype,domain, host, aproto,addr, port, txt,flags):
+ global services
+ sname = discovery.servicenames[stype]
+ svc = Service()
+ svc.name = name
+ svc.ip = addr
+ svc.port = port
+ services[sname] = svc
+ print "services[%s] = %s" % (sname, svc)
+
+listener = ZeroconfListener()
+browser = discovery.Browser(args=('_ssh._tcp','_pulse-server._tcp','_nameserver._udp'))
+browser.set_listener(listener)
+browser.start()
+
+services = {}
+services['proxy'] = Service()
+services['proxy'].ip = '192.168.32.3'
+services['proxy'].port = 3128
+services['gateway'] = Service()
+services['gateway'].ip = '192.168.32.1'
+
+machine = Host()
+machine.ip = '192.168.1.2'
+machine.hostname = 'portnov'
+
+time.sleep(5)
+
+system = read_template('configs/templates/system.xml')
+scfg = system(proxy='{{services.proxy.uri}}')
+print "First config:"
+print do_render(scfg)
+
+ncfg = scfg(dns='{{services.dns.ip}}')
+print "Second config:"
+print do_render(ncfg)
+