diff options
author | Maks Verver <maksverver@geocities.com> | 2014-04-19 18:03:54 +0200 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2014-04-20 19:36:47 +0200 |
commit | 39f80743e9ed4e6a3d1027e645d84c5779cb1a8f (patch) | |
tree | 6723428298b97f03e341db223a79d94fed632484 /src/redshift-gtk/statusicon.py | |
parent | Try to use DISPLAY=:0 if not in X (diff) | |
download | redshift-ng-39f80743e9ed4e6a3d1027e645d84c5779cb1a8f.tar.gz redshift-ng-39f80743e9ed4e6a3d1027e645d84c5779cb1a8f.tar.bz2 redshift-ng-39f80743e9ed4e6a3d1027e645d84c5779cb1a8f.tar.xz |
Fix line splitting logic.
Diffstat (limited to '')
-rw-r--r-- | src/redshift-gtk/statusicon.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py index 08f28ef..ec0dfe8 100644 --- a/src/redshift-gtk/statusicon.py +++ b/src/redshift-gtk/statusicon.py @@ -289,7 +289,7 @@ class RedshiftStatusIcon(object): if key == 'Status': self.change_status(value != 'Disabled') elif key == 'Color temperature': - self.change_temperature(int(value[:-1], 10)) + self.change_temperature(int(value.rstrip('K'), 10)) elif key == 'Period': self.change_period(value) elif key == 'Location': @@ -308,9 +308,10 @@ class RedshiftStatusIcon(object): ib.buf += os.read(f, 256).decode('utf-8') # Split input at line break - sep = True - while sep != '': + while True: first, sep, last = ib.buf.partition('\n') + if sep == '': + break ib.buf = last ib.lines.append(first) if stdout: |