How to use the wpgtk.data.files.get_file_list function in wpgtk

To help you get started, we’ve selected a few wpgtk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deviantfero / wpgtk / wpgtk / __main__.py View on Github external
logging.error("you have no themes")
            exit(1)

    if args.s:
        if len(args.s) == 1:
            themer.set_theme(args.s[0], args.s[0], args.r)
        elif len(args.s) == 2:
            themer.set_theme(args.s[0], args.s[1], args.r)
        exit(0)

    if args.l:
        if args.t:
            templates = files.get_file_list(OPT_DIR, False)
            any(print(t) for t in templates if ".base" in t)
        else:
            print("\n".join(files.get_file_list()))
        exit(0)

    if args.version:
        print("current version: " + __version__)
        exit(0)

    if args.d:
        delete_action = files.delete_template if args.t \
                        else themer.delete_theme
        try:
            any(delete_action(x) for x in args.d)
        except IOError:
            logging.error("file not found")
            exit(1)

        exit(0)
github deviantfero / wpgtk / wpgtk / gui / theme_picker.py View on Github external
def on_set_clicked(self, widget):
        x = self.option_combo.get_active()
        y = self.colorscheme.get_active()
        current_walls = files.get_file_list()
        if current_walls:
            filename = current_walls[x]
            colorscheme_file = current_walls[y]
            themer.set_theme(filename, colorscheme_file)
github deviantfero / wpgtk / wpgtk / gui / color_grid.py View on Github external
self.ok_button = Gtk.Button("Save")
        self.ok_button.connect("pressed", self.on_ok_click)
        self.ok_button.set_sensitive(False)

        self.auto_button = Gtk.Button("Auto-adjust")
        self.auto_button.connect("pressed", self.on_auto_click)
        self.auto_button.set_sensitive(False)

        self.reset_button = Gtk.Button("Reset")
        self.reset_button.set_sensitive(False)
        self.reset_button.connect("pressed", self.on_reset_click)

        self.done_lbl = Gtk.Label("")

        option_list = Gtk.ListStore(str)
        for elem in list(files.get_file_list()):
            option_list.append([elem])

        self.option_combo = Gtk.ComboBox.new_with_model(option_list)
        self.renderer_text = Gtk.CellRendererText()
        self.option_combo.pack_start(self.renderer_text, True)
        self.option_combo.add_attribute(self.renderer_text, "text", 0)
        self.option_combo.set_entry_text_column(0)
        self.option_combo.connect("changed", self.combo_box_change)

        self.combo_grid.attach(self.option_combo, 0, 0, 3, 1)
        self.combo_grid.attach(self.reset_button, 3, 0, 1, 1)

        self.button_grid.attach(self.ok_button, 0, 0, 1, 1)
        self.button_grid.attach(self.auto_button, 1, 0, 1, 1)
        self.button_grid.attach(self.shuffle_button, 2, 0, 1, 1)
        self.button_grid.attach(self.import_button, 3, 0, 1, 1)
github deviantfero / wpgtk / wpgtk / gui / theme_picker.py View on Github external
self.cpage = color_grid.ColorGrid(self)
        self.fpage = template_grid.TemplateGrid(self)
        self.optpage = option_grid.OptionsGrid(self)
        self.keypage = keyword_grid.KeywordGrid(self)

        self.notebook.append_page(self.wpage, Gtk.Label('Set'))
        self.notebook.append_page(self.cpage, Gtk.Label('Colors'))
        self.notebook.append_page(self.fpage, Gtk.Label('Templates'))
        self.notebook.append_page(self.keypage, Gtk.Label('Keywords'))
        self.notebook.append_page(self.optpage, Gtk.Label('Options'))

        option_list = Gtk.ListStore(str)
        current_idx = None

        for (i, elem) in enumerate(files.get_file_list()):
            if elem == themer.get_current():
                current_idx = i

            option_list.append([elem])

        self.option_combo = Gtk.ComboBox.new_with_model(option_list)
        self.renderer_text = Gtk.CellRendererText()
        self.option_combo.pack_start(self.renderer_text, True)
        self.option_combo.add_attribute(self.renderer_text, 'text', 0)
        self.option_combo.set_entry_text_column(0)

        self.textbox = Gtk.Label()
        self.textbox.set_text('Select colorscheme')
        self.colorscheme = Gtk.ComboBox.new_with_model(option_list)
        self.colorscheme.pack_start(self.renderer_text, True)
        self.colorscheme.add_attribute(self.renderer_text, 'text', 0)
github deviantfero / wpgtk / wpgtk / gui / theme_picker.py View on Github external
def on_rm_clicked(self, widget):
        x = self.option_combo.get_active()
        current_walls = files.get_file_list()
        if current_walls:
            filename = current_walls[x]
            themer.delete_theme(filename)
            option_list = Gtk.ListStore(str)
            for elem in list(files.get_file_list()):
                option_list.append([elem])
            self.option_combo.set_model(option_list)
            self.option_combo.set_entry_text_column(0)
            self.colorscheme.set_model(option_list)
            self.colorscheme.set_entry_text_column(0)
            self.cpage.update_combo(option_list)