Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
self.parent.sample.set_from_pixbuf(self.pixbuf_sample)
def render_sample(self):
sample.create_sample(self.color_list)
sample_path = os.path.join(WALL_DIR, ".tmp.sample.png")
self.pixbuf_sample = GdkPixbuf.Pixbuf.new_from_file_at_size(
str(sample_path),
width=500,
height=300)
self.sample.set_from_pixbuf(self.pixbuf_sample)