]> git.pld-linux.org Git - packages/xorg-xserver-server.git/blobdiff - python3.patch
- port fdi2iclass.py to python 3
[packages/xorg-xserver-server.git] / python3.patch
diff --git a/python3.patch b/python3.patch
new file mode 100644 (file)
index 0000000..9016f20
--- /dev/null
@@ -0,0 +1,69 @@
+--- xorg-server-21.1.8/config/fdi2iclass.py.orig       2023-10-03 00:42:37.000000000 +0200
++++ xorg-server-21.1.8/config/fdi2iclass.py    2023-10-03 00:47:09.544768698 +0200
+@@ -65,7 +65,7 @@
+     booltype = False
+     # see what type of key we have
+-    if node.attributes.has_key('key'):
++    if 'key' in node.attributes:
+         key = node.attributes['key'].nodeValue
+         if key in match_table:
+             match = match_table[key]
+@@ -76,18 +76,18 @@
+     if not match and not booltype:
+         return (match, value)
+-    if node.attributes.has_key('string'):
++    if 'string' in node.attributes:
+         value = node.attributes['string'].nodeValue
+-    elif node.attributes.has_key('contains'):
++    elif 'contains' in node.attributes:
+         value = node.attributes['contains'].nodeValue
+         if match == 'MatchDevicePath':
+             value = device_glob(value)
+         elif booltype and value in cap_match_table:
+             match = cap_match_table[value]
+             value = 'yes'
+-    elif node.attributes.has_key('string_outof'):
++    elif 'string_outof' in node.attributes:
+         value = node.attributes['string_outof'].nodeValue.replace(';','|')
+-    elif node.attributes.has_key('contains_outof'):
++    elif 'contains_outof' in node.attributes:
+         all_values = node.attributes['contains_outof'].nodeValue.split(';')
+         for v in all_values:
+             if match == 'MatchDevicePath':
+@@ -166,18 +166,18 @@
+ def print_section(matches, driver, ignore, options):
+     '''Print a valid InputClass section to stdout'''
+     global num_sections
+-    print 'Section "InputClass"'
+-    print '\tIdentifier "Converted Class %d"' % num_sections
++    print('Section "InputClass"')
++    print('\tIdentifier "Converted Class %d"' % num_sections)
+     num_sections += 1
+     for m, v in matches:
+-        print '\t%s "%s"' % (m, v)
++        print('\t%s "%s"' % (m, v))
+     if driver:
+-        print '\tDriver "%s"' % driver
++        print('\tDriver "%s"' % driver)
+     if ignore:
+-        print '\tOption "Ignore" "yes"'
++        print('\tOption "Ignore" "yes"')
+     for o, v in options:
+-        print '\tOption "%s" "%s"' % (o, v)
+-    print 'EndSection'
++        print('\tOption "%s" "%s"' % (o, v))
++    print('EndSection')
+ def parse_fdi(fdi):
+     '''Parse x11 matches from fdi'''
+@@ -194,7 +194,7 @@
+         matches = parse_all_matches(match_node)
+         if num > 0:
+-            print
++            print()
+         print_section(matches, driver, ignore, options)
+         num += 1
This page took 0.06543 seconds and 4 git commands to generate.