head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.30 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.28 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.26 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.24 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.22 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.20 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.18 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.16 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.14 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.12 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.10 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.8 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.6 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.4 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.2 pkgsrc-2022Q3-base:1.1; locks; strict; comment @# @; 1.1 date 2022.09.05.15.55.43; author riastradh; state Exp; branches; next ; commitid 2Xh3B3i7YmLsQGSD; desc @@ 1.1 log @wm/openbox: Patch openbox-xdg-autostart to run in Python 3. @ text @$NetBSD$ Make this run in Python 3. --- data/autostart/openbox-xdg-autostart.orig 2013-04-17 12:27:27.000000000 +0000 +++ data/autostart/openbox-xdg-autostart @@@@ -19,6 +19,8 @@@@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +from __future__ import print_function + ME="openbox-xdg-autostart" VERSION="1.1" @@@@ -28,9 +30,7 @@@@ try: from xdg.DesktopEntry import DesktopEntry from xdg.Exceptions import ParsingError except ImportError: - print - print >>sys.stderr, "ERROR:", ME, "requires PyXDG to be installed" - print + sys.stderr.write("\nERROR: %s requires PyXDG to be installed\n\n" % (ME,)) sys.exit(1) def main(argv=sys.argv): @@@@ -51,7 +51,7 @@@@ def main(argv=sys.argv): 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 @@@@ class AutostartFile: 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 @@@@ class AutostartFile: 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 @@@@ class AutostartFile: 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()) @