libpurple/dbus-analyze-signals.py

changeset 37984
6a5ca046a90d
parent 37983
7d134a4a87b2
child 38358
30ba44276e74
--- a/libpurple/dbus-analyze-signals.py	Thu Sep 01 23:42:21 2016 -0400
+++ b/libpurple/dbus-analyze-signals.py	Thu Sep 01 23:58:47 2016 -0400
@@ -12,18 +12,20 @@
 import re
 import sys
 
+
 # List "excluded" contains signals that shouldn't be exported via
 # DBus.  If you remove a signal from this list, please make sure
 # that it does not break "make" with the configure option
 # "--enable-dbus" turned on.
 
-excluded = [\
+excluded = [
     # purple_dbus_signal_emit_purple prevents our "dbus-method-called"
     # signal from being propagated to dbus.
-	"dbus-method-called",
-    ]
+    "dbus-method-called",
+]
 
-registerregex = re.compile("purple_signal_register[^;]+\"([\w\-]+)\"[^;]+(purple_marshal_\w+)[^;]+;")
+registerregex = re.compile(
+    "purple_signal_register[^;]+\"([\w\-]+)\"[^;]+(purple_marshal_\w+)[^;]+;")
 nameregex = re.compile('[-_][a-z]')
 
 parser = argparse.ArgumentParser()
@@ -33,7 +35,7 @@
                     help='Output to file instead of stdout')
 cmd_args = parser.parse_args()
 
-print("/* Generated by %s.  Do not edit! */" % sys.argv[0],
+print("/* Generated by %s.  Do not edit! */" % (sys.argv[0], ),
       file=cmd_args.output)
 print("const char *dbus_signals = ", file=cmd_args.output)
 input = ''.join(list(fileinput.input(cmd_args.input)))
@@ -43,8 +45,8 @@
     if signal in excluded:
         continue
 
-    signal = nameregex.sub(lambda x:x.group()[1].upper(), '-'+signal)
-    print("\"    <signal name='%s'>\\n\"" % signal, file=cmd_args.output)
+    signal = nameregex.sub(lambda x: x.group()[1].upper(), '-' + signal)
+    print("\"    <signal name='%s'>\\n\"" % (signal, ), file=cmd_args.output)
 
     args = marshal.split('_')
     # ['purple', 'marshal', <return type>, '', args...]
@@ -64,7 +66,8 @@
                 type = 't'
             elif arg == "BOOLEAN":
                 type = 'b'
-            print("\"      <arg type='%s'/>\\n\"" % type, file=cmd_args.output)
+            print("\"      <arg type='%s'/>\\n\"" % (type, ),
+                  file=cmd_args.output)
 
     print("\"    </signal>\\n\"", file=cmd_args.output)
 

mercurial