From 23be79866ac00e6f3f0c13d047101c1c027315cc Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 27 Jan 2016 08:00:48 -0500 Subject: [PATCH 1/5] Cleanup. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 31a372c..f50d169 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import re -# from distutils.core import setup from setuptools import setup version = re.search( From a3940a1cad57ccfb9b4c664be2abc464d3c9fb54 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 27 Jan 2016 08:01:56 -0500 Subject: [PATCH 2/5] Fixed subprocess output getting printed on editor. --- suplemon/modules/battery.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suplemon/modules/battery.py b/suplemon/modules/battery.py index 0df0325..a848b02 100644 --- a/suplemon/modules/battery.py +++ b/suplemon/modules/battery.py @@ -1,5 +1,6 @@ # -*- encoding: utf-8 +import os import time import subprocess @@ -71,7 +72,8 @@ def battery_status_read(self): def battery_status_acpi(self): """Get the battery status via acpi.""" try: - raw_str = subprocess.check_output(["acpi"]) + FNULL = open(os.devnull, 'w') + raw_str = subprocess.check_output(["acpi"], stdout=FNULL, stderr=FNULL) except: return None raw_str = raw_str.decode("utf-8") @@ -91,6 +93,7 @@ def battery_status_upower(self): except: return None raw_str = raw_str.decode("utf-8") + raw_str = raw_str.splitlines()[0] part = helpers.get_string_between("percentage:", "%", raw_str) if part: try: From c8ee476a86a5b86bf12e10e9adc9d7b98220765a Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 27 Jan 2016 08:02:06 -0500 Subject: [PATCH 3/5] Bumped version. --- suplemon/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suplemon/main.py b/suplemon/main.py index 883f4c5..e55e045 100644 --- a/suplemon/main.py +++ b/suplemon/main.py @@ -4,7 +4,7 @@ The main class that starts and runs Suplemon. """ -__version__ = "0.1.43" +__version__ = "0.1.44" import os import sys From 8bd805e5906b4b6c1fb115b54de0854552721c66 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 27 Jan 2016 08:36:17 -0500 Subject: [PATCH 4/5] Fixed linting. --- suplemon/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/suplemon/main.py b/suplemon/main.py index e55e045..ecc8477 100644 --- a/suplemon/main.py +++ b/suplemon/main.py @@ -4,7 +4,6 @@ The main class that starts and runs Suplemon. """ -__version__ = "0.1.44" import os import sys @@ -19,6 +18,8 @@ from .config import Config from .editor import Editor +__version__ = "0.1.44" + class App: def __init__(self, filenames=None, config_file=None): From e2729d283e670e389e9b01716d09cdf02f758850 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 27 Jan 2016 08:44:06 -0500 Subject: [PATCH 5/5] Fixed linting. --- suplemon/modules/battery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suplemon/modules/battery.py b/suplemon/modules/battery.py index a848b02..7a5cf65 100644 --- a/suplemon/modules/battery.py +++ b/suplemon/modules/battery.py @@ -72,7 +72,7 @@ def battery_status_read(self): def battery_status_acpi(self): """Get the battery status via acpi.""" try: - FNULL = open(os.devnull, 'w') + FNULL = open(os.devnull, "w") raw_str = subprocess.check_output(["acpi"], stdout=FNULL, stderr=FNULL) except: return None