mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-01 15:35:42 +02:00
Cleanup: Move all arg processing to process_args()
This commit is contained in:
parent
5efd215969
commit
7f78e52965
26
wal
26
wal
@ -100,7 +100,16 @@ def process_args(args):
|
|||||||
if not args.n:
|
if not args.n:
|
||||||
set_wallpaper(image)
|
set_wallpaper(image)
|
||||||
|
|
||||||
return colors
|
# Set the colors.
|
||||||
|
send_sequences(colors, args.t)
|
||||||
|
export_colors(colors)
|
||||||
|
|
||||||
|
# -o
|
||||||
|
if args.o:
|
||||||
|
subprocess.Popen(["nohup", args.o],
|
||||||
|
stdout=open("/dev/null", "w"),
|
||||||
|
stderr=open("/dev/null", "w"),
|
||||||
|
preexec_fn=os.setpgrp)
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
@ -539,21 +548,8 @@ def hex_to_rgb(color):
|
|||||||
def main():
|
def main():
|
||||||
"""Main script function."""
|
"""Main script function."""
|
||||||
create_cache_dir()
|
create_cache_dir()
|
||||||
|
|
||||||
# Get the args.
|
|
||||||
args = get_args()
|
args = get_args()
|
||||||
colors = process_args(args)
|
process_args(args)
|
||||||
|
|
||||||
# Set the colors.
|
|
||||||
send_sequences(colors, args.t)
|
|
||||||
export_colors(colors)
|
|
||||||
|
|
||||||
# -o
|
|
||||||
if args.o:
|
|
||||||
subprocess.Popen(["nohup", args.o],
|
|
||||||
stdout=open("/dev/null", "w"),
|
|
||||||
stderr=open("/dev/null", "w"),
|
|
||||||
preexec_fn=os.setpgrp)
|
|
||||||
|
|
||||||
# This saves 10ms.
|
# This saves 10ms.
|
||||||
# pylint: disable=W0212
|
# pylint: disable=W0212
|
||||||
|
Loading…
x
Reference in New Issue
Block a user