openbox-python3.patch 4.5 KB

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