openbox: move openbox-xdg-autostart helper to py3
This commit is contained in:
parent
9471d78c9f
commit
c5d4f2d0c2
2 changed files with 138 additions and 2 deletions
136
srcpkgs/openbox/patches/py3-xdg-launcher.patch
Normal file
136
srcpkgs/openbox/patches/py3-xdg-launcher.patch
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
From f5d269ae795862d3f4d01a0d26e5e4300d9472b6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Mayo <aklhfex@gmail.com>
|
||||||
|
Date: Fri, 29 Nov 2019 19:32:03 +0000
|
||||||
|
Subject: [PATCH] Make openbox-xdg-autostart Python 3 compatible
|
||||||
|
|
||||||
|
Use of __future__ required to support file=sys.stderr
|
||||||
|
---
|
||||||
|
data/autostart/openbox-xdg-autostart | 72 ++++++++++++++--------------
|
||||||
|
1 file changed, 37 insertions(+), 35 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/data/autostart/openbox-xdg-autostart b/data/autostart/openbox-xdg-autostart
|
||||||
|
index 04a17a199..f2c75bbdd 100755
|
||||||
|
--- a/data/autostart/openbox-xdg-autostart
|
||||||
|
+++ b/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,9 @@ 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
|
||||||
|
+ print()
|
||||||
|
+ print("ERROR:", ME, "requires PyXDG to be installed", file=sys.stderr)
|
||||||
|
+ print()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
def main(argv=sys.argv):
|
||||||
|
@@ -51,7 +53,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 +101,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 +148,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 +167,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())
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'openbox'
|
# Template file for 'openbox'
|
||||||
pkgname=openbox
|
pkgname=openbox
|
||||||
version=3.6.1
|
version=3.6.1
|
||||||
revision=3
|
revision=4
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--enable-startup-notification $(vopt_enable svg librsvg)"
|
configure_args="--enable-startup-notification $(vopt_enable svg librsvg)"
|
||||||
hostmakedepends="automake libtool pkg-config gettext-devel"
|
hostmakedepends="automake libtool pkg-config gettext-devel"
|
||||||
|
@ -19,7 +19,7 @@ license="GPL-2"
|
||||||
homepage="http://www.openbox.org"
|
homepage="http://www.openbox.org"
|
||||||
distfiles="http://openbox.org/dist/openbox/openbox-$version.tar.xz"
|
distfiles="http://openbox.org/dist/openbox/openbox-$version.tar.xz"
|
||||||
checksum=abe75855cc5616554ffd47134ad15291fe37ebbebf1a80b69cbde9d670f0e26d
|
checksum=abe75855cc5616554ffd47134ad15291fe37ebbebf1a80b69cbde9d670f0e26d
|
||||||
python_version=2 #unverified
|
python_version=3
|
||||||
|
|
||||||
# Package build options
|
# Package build options
|
||||||
build_options="svg"
|
build_options="svg"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue