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
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
18 -#!/usr/bin/python2 -u
21 # Copyright (C) 2013, Daniel Narvaez
23 @@ -66,7 +66,7 @@ def _allow_to_run_x():
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
46 -#!/usr/bin/python2 -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
56 -#!/usr/bin/python2 -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():
65 - print SugarRunner.window_get_xid()
66 + print(SugarRunner.window_get_xid())
68 diff --git a/scripts/xinitrc b/scripts/xinitrc
69 index 904822e..de75d8f 100644
76 # Copyright (C) 2013, Daniel Narvaez
78 @@ -48,7 +48,7 @@ def _load_xkb_config():
79 if "SUGAR_RUNNER_XKBCONFIG" not in os.environ:
82 - with open(os.environ["SUGAR_RUNNER_XKBCONFIG"]) as f:
83 + with open(os.environ["SUGAR_RUNNER_XKBCONFIG"], 'rb') as f:
86 process = subprocess.Popen(["xkbcomp", "-", os.environ["DISPLAY"]],
87 @@ -65,14 +65,14 @@ def _add_output_to_environ(output):
90 output = subprocess.check_output(["dbus-launch", "--exit-with-session"])
91 - _add_output_to_environ(output)
92 + _add_output_to_environ(output.decode('ascii'))
96 output = subprocess.check_output(["gnome-keyring-daemon",
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():