aboutsummaryrefslogtreecommitdiffstats
path: root/src/redshift-gtk/statusicon.py
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-12-29 19:41:10 -0500
committerTingPing <tingping@tingping.se>2014-01-01 14:11:11 -0500
commit8768ba76f8b6aa760822e1c83ba82477ae601314 (patch)
treee96047211ddc4d05578ed9bbe2cfc17e593e6abc /src/redshift-gtk/statusicon.py
parentMerge pull request #19 from TingPing/patch-1 (diff)
downloadredshift-ng-8768ba76f8b6aa760822e1c83ba82477ae601314.tar.gz
redshift-ng-8768ba76f8b6aa760822e1c83ba82477ae601314.tar.bz2
redshift-ng-8768ba76f8b6aa760822e1c83ba82477ae601314.tar.xz
Port redshift-gtk to Python3
Python 2 is no longer supported
Diffstat (limited to 'src/redshift-gtk/statusicon.py')
-rw-r--r--src/redshift-gtk/statusicon.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py
index 15a822b..626b9e3 100644
--- a/src/redshift-gtk/statusicon.py
+++ b/src/redshift-gtk/statusicon.py
@@ -34,8 +34,8 @@ try:
except ImportError:
appindicator = None
-import defs
-import utils
+from . import defs
+from . import utils
_ = gettext.gettext
@@ -99,7 +99,7 @@ class RedshiftStatusIcon(object):
try:
autostart_item.set_active(utils.get_autostart())
except IOError as strerror:
- print strerror
+ print(strerror)
autostart_item.set_property('sensitive', False)
else:
autostart_item.connect('toggled', self.autostart_cb)
@@ -185,7 +185,7 @@ class RedshiftStatusIcon(object):
# Start child process with C locale so we can parse the output
env = os.environ.copy()
env['LANG'] = env['LANGUAGE'] = env['LC_ALL'] = env['LC_MESSAGES'] = 'C'
- self.process = GLib.spawn_async(args, envp=['{}={}'.format(k,v) for k, v in env.iteritems()],
+ self.process = GLib.spawn_async(args, envp=['{}={}'.format(k,v) for k, v in env.items()],
flags=GLib.SPAWN_DO_NOT_REAP_CHILD,
standard_output=True, standard_error=True)
@@ -299,7 +299,7 @@ class RedshiftStatusIcon(object):
def child_data_cb(self, f, cond, data):
stdout, ib = data
- ib.buf += os.read(f, 256)
+ ib.buf += os.read(f, 256).decode('utf-8')
# Split input at line break
sep = True