Permalink
Browse files

fall back for port number

  • Loading branch information...
1 parent e83e69e commit 52f83e141842aa93ad8461fc17748bd552daf6b1 @tjfontaine committed Nov 23, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 airprint-generate.py
@@ -132,7 +132,12 @@ def generate(self):
service = tree.find('service')
port = service.find('port')
- port.text = '%d' % uri.port
+ port_no = uri.port
+ if not port_no:
+ port_no = self.port
+ if not port_no:
+ port_no = cups.getPort()
+ port.text = '%d' % port_no
path = Element('txt-record')
path.text = 'rp=%s' % (uri.path)

0 comments on commit 52f83e1

Please sign in to comment.