[IMP] posbox: print the homepage url on the status ticket
authorFrédéric van der Essen <fva@openerp.com>
Fri, 21 Mar 2014 16:37:40 +0000 (17:37 +0100)
committerFrédéric van der Essen <fva@openerp.com>
Fri, 21 Mar 2014 16:37:40 +0000 (17:37 +0100)
bzr revid: fva@openerp.com-20140321163740-0o0b3ikmz6jv6cwr

addons/hw_escpos/controllers/main.py

index 56c56a1..b647e5c 100644 (file)
@@ -147,12 +147,15 @@ class EscposDriver(Thread):
         if len(ips) == 0:
             eprint.text('ERROR: Could not connect to LAN\n\nPlease check that the PosBox is correc-\ntly connected with a network cable,\n that the LAN is setup with DHCP, and\nthat network addresses are available')
         elif len(ips) == 1:
-            eprint.text('IP Address\n'+ips[0]+'\n')
+            eprint.text('IP Address:\n'+ips[0]+'\n')
         else:
-            eprint.text('IP Addresses\n')
+            eprint.text('IP Addresses:\n')
             for ip in ips:
                 eprint.text(ip+'\n')
 
+        if len(ips) >= 1:
+            eprint.text('\nHomepage:\nhttp://'+ips[0]+':8069\n')
+
         eprint.text('\n\n')
         eprint.cut()
 
@@ -283,6 +286,8 @@ class EscposDriver(Thread):
 
 driver = EscposDriver()
 
+driver.push_task('printstatus')
+
 hw_proxy.drivers['escpos'] = driver
 
 class EscposProxy(hw_proxy.Proxy):