summaryrefslogtreecommitdiff
path: root/pywal/util.py
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-30 09:28:23 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-30 09:28:23 +1000
commit6ca3fa2763c15feccf7902dbb9dd95a3e6ddb4c3 (patch)
tree20c51ab8f085b822fcc304407a24fe7d91e5c823 /pywal/util.py
parentd865a5fd3cb7bc93091564abecc8b2c1aca35d04 (diff)
tests: Fix linting and tests.
Diffstat (limited to 'pywal/util.py')
-rwxr-xr-xpywal/util.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/pywal/util.py b/pywal/util.py
index 820be10..0b4977b 100755
--- a/pywal/util.py
+++ b/pywal/util.py
@@ -7,6 +7,21 @@ import pathlib
import subprocess
+# pylint: disable=too-few-public-methods
+class Color(object):
+ """Color formats."""
+ def __init__(self, hex_color):
+ self.hex_color = hex_color
+
+ def __str__(self):
+ return self.hex_color
+
+ @property
+ def rgb(self):
+ """Convert a hex color to rgb."""
+ return hex_to_rgb(self.hex_color)
+
+
def read_file(input_file):
"""Read colors from a file."""
with open(input_file) as file:
@@ -51,14 +66,3 @@ def disown(*cmd):
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
preexec_fn=os.setpgrp)
-
-class Color(object):
- def __init__(self, hex):
- self.hex = hex
-
- def __str__(self):
- return self.hex
-
- @property
- def rgb(self):
- return hex_to_rgb(self.hex)