openbox-3.6.1-py3-xdg.patch 4.6 KB

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