88 lines
5.1 KiB
Diff
88 lines
5.1 KiB
Diff
diff --git a/base/queues.py b/base/queues.py
|
|
index 0818574..8625f53 100755
|
|
--- a/base/queues.py
|
|
+++ b/base/queues.py
|
|
@@ -46,7 +46,7 @@ HPPS = 3
|
|
HPOTHER = 4
|
|
|
|
DEVICE_URI_PATTERN = re.compile(r"""(.*):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*)|zc=(\S+))(?:&port=(\d))?""", re.I)
|
|
-NICKNAME_PATTERN = re.compile(b'''\*NickName:\s*\"(.*)"''', re.MULTILINE)
|
|
+NICKNAME_PATTERN = re.compile(r'''\*NickName:\s*\"(.*)"''', re.MULTILINE)
|
|
NET_PATTERN = re.compile(r"""(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})""")
|
|
NET_ZC_PATTERN = re.compile(r'''zc=(.*)''',re.IGNORECASE)
|
|
NET_OTHER_PATTERN = re.compile(r'''(.*)://(.*)''',re.IGNORECASE)
|
|
@@ -149,7 +149,7 @@ def parseQueues(mode):
|
|
desc=''
|
|
else:
|
|
try:
|
|
- desc = to_string_utf8( NICKNAME_PATTERN.search(fileptr).group(1) )
|
|
+ desc = to_string_utf8( NICKNAME_PATTERN.search(fileptr.decode('utf-8')).group(1) )
|
|
except AttributeError:
|
|
desc = ''
|
|
|
|
diff --git a/check.py b/check.py
|
|
index 284b88e..86ca832 100755
|
|
--- a/check.py
|
|
+++ b/check.py
|
|
@@ -627,7 +627,7 @@ class DependenciesCheck(object):
|
|
status, output = utils.run("%s -d03f0:" % lsusb)
|
|
|
|
if output:
|
|
- lsusb_pat = re.compile("""^Bus\s([0-9a-fA-F]{3,3})\sDevice\s([0-9a-fA-F]{3,3}):\sID\s([0-9a-fA-F]{4,4}):([0-9a-fA-F]{4,4})(.*)""", re.IGNORECASE)
|
|
+ lsusb_pat = re.compile(r"""^Bus\s([0-9a-fA-F]{3,3})\sDevice\s([0-9a-fA-F]{3,3}):\sID\s([0-9a-fA-F]{4,4}):([0-9a-fA-F]{4,4})(.*)""", re.IGNORECASE)
|
|
log.debug(output)
|
|
try:
|
|
hpmudext = utils.import_ext('hpmudext')
|
|
@@ -682,7 +682,7 @@ class DependenciesCheck(object):
|
|
|
|
out =''
|
|
for g in getfacl_out_list:
|
|
- if 'getfacl' not in g and '' is not g and 'file' not in g:
|
|
+ if 'getfacl' not in g and '' != g and 'file' not in g:
|
|
pat = re.compile('''.*:(.*)''')
|
|
if pat.search(g):
|
|
out = out +' '+ pat.search(g).group(1)
|
|
diff --git a/fax/soapfax.py b/fax/soapfax.py
|
|
index 9865726..344cb34 100644
|
|
--- a/fax/soapfax.py
|
|
+++ b/fax/soapfax.py
|
|
@@ -42,7 +42,7 @@ from base.sixext import to_bytes_utf8
|
|
|
|
# **************************************************************************** #
|
|
|
|
-http_result_pat = re.compile("""HTTP/\d.\d\s(\d+)""", re.I)
|
|
+http_result_pat = re.compile(r"""HTTP/\d.\d\s(\d+)""", re.I)
|
|
|
|
|
|
TIME_FORMAT_AM_PM = 1
|
|
diff --git a/makeuri.py b/makeuri.py
|
|
index 4a10de8..6343e31 100755
|
|
--- a/makeuri.py
|
|
+++ b/makeuri.py
|
|
@@ -46,7 +46,7 @@ USAGE = [ (__doc__, "", "name", True),
|
|
("DEVNODE (parallel only):", '"/dev/parportX", X=0,1,2,...', "option", False),
|
|
("SERIAL NO. (usb and parallel only):", '"serial no."', "option", True),
|
|
utils.USAGE_OPTIONS,
|
|
- ("To specify the port on a multi-port JetDirect:", "-p<port> or --port=<port> (Valid values are 1\*, 2, and 3. \*default)", "option", False),
|
|
+ ("To specify the port on a multi-port JetDirect:", r"-p<port> or --port=<port> (Valid values are 1\*, 2, and 3. \*default)", "option", False),
|
|
("Show the CUPS URI only (quiet mode):", "-c or --cups", "option", False),
|
|
("Show the SANE URI only (quiet mode):", "-s or --sane", "option", False),
|
|
("Show the HP Fax URI only (quiet mode):", "-f or --fax", "option", False),
|
|
diff --git a/probe.py b/probe.py
|
|
index 2041fb6..2b43ece 100755
|
|
--- a/probe.py
|
|
+++ b/probe.py
|
|
@@ -42,11 +42,11 @@ USAGE = [(__doc__, "", "name", True),
|
|
("Usage: %s [OPTIONS]" % __mod__, "", "summary", True),
|
|
utils.USAGE_OPTIONS,
|
|
("Bus to probe:", "-b<bus> or --bus=<bus>", "option", False),
|
|
- ("", "<bus>: cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)", "option", False),
|
|
+ ("", r"<bus>: cups, usb\*, net, bt, fw, par (\*default) (Note: bt and fw not supported in this release.)", "option", False),
|
|
("Set Time to Live (TTL):", "-t<ttl> or --ttl=<ttl> (Default is 4).", "option", False),
|
|
("Set timeout:", "-o<timeout in secs.> or --timeout=<timeout is secs.>", "option", False),
|
|
("Filter by functionality:", "-e<filter list> or --filter=<filter list>", "option", False),
|
|
- ("", "<filter list>: comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)", "option", False),
|
|
+ ("", r"<filter list>: comma separated list of one or more of: scan, pcard, fax, copy, or none\*. (\*none is the default)", "option", False),
|
|
("Search:", "-s<search re> or --search=<search re>", "option", False),
|
|
("", "<search re> must be a valid regular expression (not case sensitive)", "option", False),
|
|
("Network discovery method:", "-m<method> or --method=<method>: <method> is 'slp'* or 'mdns'.", "option", False),
|