summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-26 23:23:38 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-26 23:23:38 +1000
commit0b38d7affc52f002d29f551f96d9d225928d095d (patch)
tree43bd7a411570622675d9c68c27806e6bdbb3b5a0
parent21c19af696d056d1c5317f91f24f533c081b34b5 (diff)
General: Remove last global variable.
-rwxr-xr-xpywal/__main__.py3
-rwxr-xr-xpywal/gen_colors.py6
-rwxr-xr-xpywal/globals.py6
3 files changed, 4 insertions, 11 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py
index ff09f13..61c3771 100755
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -61,7 +61,6 @@ def process_args(args):
# -q
if args.q:
sys.stdout = sys.stderr = open(os.devnull, "w")
- g.Args.notify = False
# -c
if args.c:
@@ -82,7 +81,7 @@ def process_args(args):
image = gen_colors.get_image(args.i)
# Create a list of hex colors.
- colors_plain = gen_colors.get_colors(image)
+ colors_plain = gen_colors.get_colors(image, args.q)
colors_plain[8] = set_colors.set_grey(colors_plain)
if not args.n:
diff --git a/pywal/gen_colors.py b/pywal/gen_colors.py
index 6c3293a..5c5fb1b 100755
--- a/pywal/gen_colors.py
+++ b/pywal/gen_colors.py
@@ -84,7 +84,7 @@ def gen_colors(img):
return [re.search("#.{6}", str(col)).group(0) for col in raw_colors]
-def get_colors(img):
+def get_colors(img, quiet):
"""Generate a colorscheme using imagemagick."""
# Cache the wallpaper name.
util.save_file(img, g.CACHE_DIR / "wal")
@@ -98,7 +98,7 @@ def get_colors(img):
else:
print("colors: Generating a colorscheme...")
- if g.Args.notify:
+ if not quiet:
util.disown("notify-send", "wal: Generating a colorscheme...")
# Generate the colors.
@@ -109,7 +109,7 @@ def get_colors(img):
util.save_file("\n".join(colors), cache_file)
print("colors: Generated colorscheme")
- if g.Args.notify:
+ if not quiet:
util.disown("notify-send", "wal: Generation complete.")
return colors
diff --git a/pywal/globals.py b/pywal/globals.py
index 6a45fa8..c72b37a 100755
--- a/pywal/globals.py
+++ b/pywal/globals.py
@@ -10,9 +10,3 @@ __version__ = "0.2.0"
# Internal variables.
COLOR_COUNT = 16
CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
-
-
-# pylint: disable=too-few-public-methods
-class Args(object):
- """Store args."""
- notify = True