Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def split(self,file):
text = open(file).read()
t = self.translateGradient(text)
for grad in t.children:
t = translate.GradientFunc(grad)
g = gradient.Gradient()
g.load_ugr(t)
out_name = g.name + ".ggr"
f = open("gradients/" + out_name, "w")
print >>f, g.serialize()
f.close()
self.icongroups = IconGroupCollector(self.config)
# Filter edit helper
self.filter_editor = RawFilterEditor(self.config.get("Directories", "editor"))
# Create object for preview render control
self.render = ActionHandler(self.fullrefresh)
# Connect preview render controller to filters class
CustomFilterBase.connect_render(self.render)
# Load filters from certain directory
self.filters = FilterCollector(self.config.get("Directories", "filters"))
# Build griadient object
self.gradient = gradient.Gradient()
# Load GUI
self.builder = Gtk.Builder()
self.builder.add_from_file('gui.glade')
gui_elements = (
'window', 'preview_icon', 'color_list_store', 'color_tree_view', 'direction_list_store',
'offset_scale', 'offset_switch', 'alt_group_combo', 'alt_theme_combo', 'gradient_combo',
'filters_combo', 'iconview_combo', 'icongroup_combo', 'alt_icon_store', 'iconview_store',
'custom_icon_tree_view', 'refresh_button', 'filter_settings_button', 'apply_button',
'custom_icons_store', 'color_selector', 'notebook', 'rtr_button', 'filter_group_combo',
'filter_edit_textbuffer', 'filter_preview_icon', 'filter_edit_info_label', 'filter_edit_textview'
)
self.gui = {element: self.builder.get_object(element) for element in gui_elements}
self.gui['filter_edit_textview'].modify_font(Pango.FontDescription("Monospace"))