upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / sugar-runner / trunk / 0001-Python-3-port.patch
blob14a92f62a11f4f1bae8566ddff190804d6c12021
1 From 2bbb41c38f81f53e5c8d0be7a1847bc0674fd424 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
3 Date: Mon, 9 Mar 2020 20:06:25 +0100
4 Subject: [PATCH] Python 3 port
6 ---
7 scripts/sugar-runner.in | 6 +++---
8 scripts/tweak-xwrapper | 2 +-
9 scripts/xephyr-window | 4 ++--
10 scripts/xinitrc | 8 ++++----
11 4 files changed, 10 insertions(+), 10 deletions(-)
13 diff --git a/scripts/sugar-runner.in b/scripts/sugar-runner.in
14 index f39bdfb..9aa83ff 100644
15 --- a/scripts/sugar-runner.in
16 +++ b/scripts/sugar-runner.in
17 @@ -1,4 +1,4 @@
18 -#!/usr/bin/python2 -u
19 +#!/usr/bin/python -u
21 # Copyright (C) 2013, Daniel Narvaez
23 @@ -66,7 +66,7 @@ def _allow_to_run_x():
24 except IOError:
25 return
27 - print "We need to allow everybody to run the X server"
28 + print("We need to allow everybody to run the X server")
29 tweak_wrapper = os.path.join(helpers_dir, "tweak-xwrapper")
30 subprocess.check_call(["sudo", "-k", tweak_wrapper])
32 @@ -83,7 +83,7 @@ def _run_xephyr_window(resolution):
34 def _get_tty_number():
35 tty = subprocess.check_output(["tty"])
36 - head, tail = os.path.split(tty)
37 + head, tail = os.path.split(tty.decode('ascii'))
38 return tail.strip().replace("tty", "")
41 diff --git a/scripts/tweak-xwrapper b/scripts/tweak-xwrapper
42 index 05f9c6e..87ceec1 100644
43 --- a/scripts/tweak-xwrapper
44 +++ b/scripts/tweak-xwrapper
45 @@ -1,4 +1,4 @@
46 -#!/usr/bin/python2 -u
47 +#!/usr/bin/python -u
49 # Copyright (C) 2013, Daniel Narvaez
51 diff --git a/scripts/xephyr-window b/scripts/xephyr-window
52 index 0c5e98b..c43434a 100644
53 --- a/scripts/xephyr-window
54 +++ b/scripts/xephyr-window
55 @@ -1,4 +1,4 @@
56 -#!/usr/bin/python2 -u
57 +#!/usr/bin/python -u
59 # Copyright (C) 2013, Daniel Narvaez
61 @@ -40,5 +40,5 @@ SugarRunner.window_create(int(width), int(height), fullscreen)
62 while SugarRunner.window_wait():
63 if not fullscreen or SugarRunner.window_is_fullscreen():
64 if not xid_printed:
65 - print SugarRunner.window_get_xid()
66 + print(SugarRunner.window_get_xid())
67 xid_printed = True
68 diff --git a/scripts/xinitrc b/scripts/xinitrc
69 index 904822e..de75d8f 100644
70 --- a/scripts/xinitrc
71 +++ b/scripts/xinitrc
72 @@ -1,4 +1,4 @@
73 -#!/usr/bin/python2
74 +#!/usr/bin/python
76 # Copyright (C) 2013, Daniel Narvaez
78 @@ -48,7 +48,7 @@ def _load_xkb_config():
79 if "SUGAR_RUNNER_XKBCONFIG" not in os.environ:
80 return
82 - with open(os.environ["SUGAR_RUNNER_XKBCONFIG"]) as f:
83 + with open(os.environ["SUGAR_RUNNER_XKBCONFIG"], 'rb') as f:
84 config = f.read()
86 process = subprocess.Popen(["xkbcomp", "-", os.environ["DISPLAY"]],
87 @@ -65,14 +65,14 @@ def _add_output_to_environ(output):
89 def _start_dbus():
90 output = subprocess.check_output(["dbus-launch", "--exit-with-session"])
91 - _add_output_to_environ(output)
92 + _add_output_to_environ(output.decode('ascii'))
95 def _start_keyring():
96 output = subprocess.check_output(["gnome-keyring-daemon",
97 "--start", "-d",
98 "--components=secrets,pkcs11,ssh,gpg"])
99 - _add_output_to_environ(output)
100 + _add_output_to_environ(output.decode('ascii'))
103 def _setup_xdg_user_dirs():
105 2.25.1