Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exit(0)
if args.theme == "list":
dark = settings['light_theme'] != "true"
name_dic = pywal.theme.list_themes(dark)
name_list = [t.name.replace(".json", "") for t in name_dic]
print("\n".join(name_list))
exit(0)
if args.sat:
cl = color.get_color_list(args.sat[0])
val = float(args.sat[1])
cl = [util.alter_brightness(x, 0, val) for x in cl]
color.write_colors(args.sat[0], cl)
sample.create_sample(cl, files.get_sample_path(args.sat[0]))
exit(0)
if args.brt:
cl = color.get_color_list(args.brt[0])
val = float(args.brt[1])
cl = [util.alter_brightness(x, val, 0) for x in cl]
color.write_colors(args.brt[0], cl)
sample.create_sample(cl, files.get_sample_path(args.brt[0]))
exit(0)
if args.theme and args.theme != "list":
light = settings['light_theme'] == "true"
themer.set_pywal_theme(args.theme, light)
exit(0)
if args.c:
print(themer.get_current())
exit(0)
if args.z or args.A:
alter_action = color.shuffle_colors if args.z \
else color.auto_adjust
arg_list = args.z if args.z else args.A
for arg in arg_list:
colors = color.get_color_list(arg)
colors = alter_action(colors)
color.write_colors(arg, colors)
sample.create_sample(colors, files.get_sample_path(arg))
logging.info("shuffled %s" % arg)
exit(0)
if args.link:
files.add_template(args.link[1], args.link[0])
exit(0)
if args.i:
themer.import_theme(args.i[0], args.i[1], args.T)
exit(0)
if args.o:
themer.export_theme(*args.o)
exit(0)
if args.R:
if args.sat:
cl = color.get_color_list(args.sat[0])
val = float(args.sat[1])
cl = [util.alter_brightness(x, 0, val) for x in cl]
color.write_colors(args.sat[0], cl)
sample.create_sample(cl, files.get_sample_path(args.sat[0]))
exit(0)
if args.brt:
cl = color.get_color_list(args.brt[0])
val = float(args.brt[1])
cl = [util.alter_brightness(x, val, 0) for x in cl]
color.write_colors(args.brt[0], cl)
sample.create_sample(cl, files.get_sample_path(args.brt[0]))
exit(0)
if args.theme and args.theme != "list":
light = settings['light_theme'] == "true"
themer.set_pywal_theme(args.theme, light)
exit(0)
if args.backend == "list":
print("\n".join(pywal.colors.list_backends()))
exit(0)
if args.update:
for arg in args.update:
if arg.endswith(".base"):
files.update_template(arg)
exit(0)
def on_ok_click(self, widget):
current_walls = files.get_file_list()
if len(current_walls) > 0:
x = self.option_combo.get_active()
color.write_colors(current_walls[x], self.color_list)
tmpfile = os.path.join(WALL_DIR, ".tmp.sample.png")
if(os.path.isfile(tmpfile)):
shutil.move(os.path.join(WALL_DIR, ".tmp.sample.png"),
files.get_sample_path(current_walls[x]))
self.done_lbl.set_text("Changes saved")
x = self.parent.colorscheme.get_active()
sample_path = files.get_sample_path(self.selected_file)
self.parent.pixbuf_sample = GdkPixbuf.Pixbuf\
.new_from_file_at_size(sample_path, width=500, height=300)
self.parent.sample.set_from_pixbuf(self.pixbuf_sample)
def render_theme(self):
sample_path = files.get_sample_path(self.selected_file)
try:
self.color_list = color.get_color_list(self.selected_file)
except SystemExit:
self.color_list = themer.set_fallback_theme(self.selected_file)
self.render_buttons()
try:
self.pixbuf_sample = GdkPixbuf.Pixbuf\
.new_from_file_at_size(sample_path, width=500, height=300)
except:
sample.create_sample(self.color_list, sample_path)
self.pixbuf_sample = GdkPixbuf.Pixbuf\
.new_from_file_at_size(sample_path, width=500, height=300)
self.sample.set_from_pixbuf(self.pixbuf_sample)