aboutsummaryrefslogtreecommitdiff
path: root/desktop/openbox/py2-to-py3.patch
blob: 060013e5d6962a66ecf912ff6ee363a1dcff01cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
--- a/data/autostart/openbox-xdg-autostart
+++ b/data/autostart/openbox-xdg-autostart
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # openbox-xdg-autostart runs things based on the XDG autostart specification
 # Copyright (C) 2008       Dana Jansens
@@ -28,9 +28,9 @@
     from xdg.DesktopEntry import DesktopEntry
     from xdg.Exceptions import ParsingError
 except ImportError:
-    print
-    print >>sys.stderr, "ERROR:", ME, "requires PyXDG to be installed"
-    print
+    print()
+    print("ERROR:", ME, "requires PyXDG to be installed", file=sys.stderr)
+    print()
     sys.exit(1)
 
 def main(argv=sys.argv):
@@ -51,7 +51,7 @@
             try:
                 autofile = AutostartFile(path)
             except ParsingError:
-                print "Invalid .desktop file: " + path
+                print("Invalid .desktop file: " + path)
             else:
                 if not autofile in files:
                     files.append(autofile)
@@ -99,9 +99,9 @@
 
     def _alert(self, str, info=False):
         if info:
-            print "\t ", str
+            print("\t ", str)
         else:
-            print "\t*", str
+            print("\t*", str)
 
     def _showInEnvironment(self, envs, verbose=False):
         default = not self.de.getOnlyShowIn()
@@ -146,14 +146,14 @@
 
     def display(self, envs):
         if self._shouldRun(envs):
-            print "[*] " + self.de.getName()
+            print("[*] " + self.de.getName())
         else:
-            print "[ ] " + self.de.getName()
+            print("[ ] " + self.de.getName())
         self._alert("File: " + self.path, info=True)
         if self.de.getExec():
             self._alert("Executes: " + self.de.getExec(), info=True)
         self._shouldRun(envs, True)
-        print
+        print()
 
     def run(self, envs):
         here = os.getcwd()
@@ -165,34 +165,34 @@
         os.chdir(here)
 
 def show_help():
-    print "Usage:", ME, "[OPTION]... [ENVIRONMENT]..."
-    print
-    print "This tool will run xdg autostart .desktop files"
-    print
-    print "OPTIONS"
-    print "  --list        Show a list of the files which would be run"
-    print "                Files which would be run are marked with an asterix"
-    print "                symbol [*].  For files which would not be run,"
-    print "                information is given for why they are excluded"
-    print "  --help        Show this help and exit"
-    print "  --version     Show version and copyright information"
-    print
-    print "ENVIRONMENT specifies a list of environments for which to run autostart"
-    print "applications.  If none are specified, only applications which do not "
-    print "limit themselves to certain environments will be run."
-    print
-    print "ENVIRONMENT can be one or more of:"
-    print "  GNOME         Gnome Desktop"
-    print "  KDE           KDE Desktop"
-    print "  ROX           ROX Desktop"
-    print "  XFCE          XFCE Desktop"
-    print "  Old           Legacy systems"
-    print
+    print("Usage:", ME, "[OPTION]... [ENVIRONMENT]...")
+    print()
+    print("This tool will run xdg autostart .desktop files")
+    print()
+    print("OPTIONS")
+    print("  --list        Show a list of the files which would be run")
+    print("                Files which would be run are marked with an asterix")
+    print("                symbol [*].  For files which would not be run,")
+    print("                information is given for why they are excluded")
+    print("  --help        Show this help and exit")
+    print("  --version     Show version and copyright information")
+    print()
+    print("ENVIRONMENT specifies a list of environments for which to run autostart")
+    print("applications.  If none are specified, only applications which do not ")
+    print("limit themselves to certain environments will be run.")
+    print()
+    print("ENVIRONMENT can be one or more of:")
+    print("  GNOME         Gnome Desktop")
+    print("  KDE           KDE Desktop")
+    print("  ROX           ROX Desktop")
+    print("  XFCE          XFCE Desktop")
+    print("  Old           Legacy systems")
+    print()
 
 def show_version():
-    print ME, VERSION
-    print "Copyright (c) 2008        Dana Jansens"
-    print
+    print(ME, VERSION)
+    print("Copyright (c) 2008        Dana Jansens")
+    print()
 
 if __name__ == "__main__":
         sys.exit(main())