Use util.read_file instead of inline file reading

This commit is contained in:
Lorenz Leitner 2019-09-11 09:35:31 +02:00
parent f44ca5da87
commit fefcd53fcf

View File

@ -179,14 +179,12 @@ def parse_args(parser):
colors_plain = theme.file(os.path.join(CACHE_DIR, "colors.json"))
if args.l:
wallpaper_cache = open(os.path.join(CACHE_DIR, "wal"))
cached_wallpaper = wallpaper_cache.read()
colors_plain = colors.get(cached_wallpaper, True, args.backend,
cached_wallpaper = util.read_file(os.path.join(CACHE_DIR, "wal"))
colors_plain = colors.get(cached_wallpaper[0], True, args.backend,
sat=args.saturate)
elif args.d:
wallpaper_cache = open(os.path.join(CACHE_DIR, "wal"))
cached_wallpaper = wallpaper_cache.read()
colors_plain = colors.get(cached_wallpaper, False, args.backend,
cached_wallpaper = util.read_file(os.path.join(CACHE_DIR, "wal"))
colors_plain = colors.get(cached_wallpaper[0], False, args.backend,
sat=args.saturate)
if args.b: