def make_package(self, widget): from os import chdir, geteuid, curdir from os.path import dirname, abspath dlg = choose_pkgbuild_dialog(self.gld.get_widget("main_win"), self.icon) fname = dlg.run() dlg.destroy() try: dname = dirname(fname) except: return pwd = abspath(curdir) chdir(dname) cdlg = command_dialog(self.icon) if geteuid() == 0: dlg = change_user_dialog(self.gld.get_widget("main_win"), self.icon) user = dlg.run() if user == "root": cdlg.run("makepkg --asroot -si") elif user == "reject": pass else: cdlg.run("su %s -c 'makepkg -si'" %user, False) dlg.destroy() else: cdlg.run("makepkg -si", False) chdir(pwd)
def refresh_database(self, widget, data=None): stat_bar = self.gld.get_widget("statusbar") stat_bar.pop(self.stat_id) stat_bar.push(self.stat_id, _("Refreshing database")) dlg = command_dialog(self.icon) dlg.connect("destroy", self._done_upgrade) dlg.run("Sy") return
def empty_cache(self, wid, data=None): stat_bar = self.gld.get_widget("statusbar") stat_bar.pop(self.stat_id) stat_bar.push(self.stat_id, _("Emptying cache...")) dlg = command_dialog() dlg.connect("destroy", self._done) dlg.run("Scc") return
def empty_cache(self, wid, data=None): main_window = self.gld.get_widget("main_win") main_window.set_sensitive(False) self._statusbar(_("Emptying cache...")) command_dlg = command_dialog(main_window, self.icon) command_dlg.connect("destroy", self._done) if self._passwd_dlg_init(command_dlg): command_dlg.install('Scc') else: command_dlg.destroy()
def refresh_database(self, widget, data=None): main_window = self.gld.get_widget("main_win") main_window.set_sensitive(False) self._statusbar(_("Refreshing database...")) command_dlg = command_dialog(main_window, self.icon) command_dlg.connect("destroy", self._refresh_trees_and_queues) if self._passwd_dlg_init(command_dlg): command_dlg.install('Sy') else: command_dlg.destroy()
def make_package(self, widget): from os.path import dirname, abspath dlg = choose_pkgbuild_dialog(self.gld.get_widget("main_win"), self.icon) fname = dlg.run() dlg.destroy() try: dname = dirname(fname) except: self.gld.get_widget("main_win").set_sensitive(True) return self.gld.get_widget("main_win").set_sensitive(False) pwd = abspath(curdir) chdir(dname) command_dlg = command_dialog(self.gld.get_widget("main_win"), self.icon) command_dlg.connect("destroy", self._done) if geteuid() == 0: dlg = change_user_dialog(self.gld.get_widget("main_win"), self.icon) user = dlg.run() dlg.destroy() if user == "root": command_dlg.install("makepkg --asroot -si \n", False) elif user == "reject": pass else: command_dlg.install("su %s -c 'makepkg -si' \n" %user, False) #command_dlg.destroy() else: if self._passwd_dlg_init(command_dlg): usr_name = getpwuid(geteuid())[0] command_dlg.install("su %s -c 'makepkg -si' \n" %usr_name, False) else: command_dlg.destroy() #command_dlg.install("makepkg -s \n", False) #command_dlg.destroy() chdir(pwd)
def refresh_database(self, widget, data=None): self._statusbar(_("Refreshing database...")) dlg = command_dialog(self.icon) dlg.connect("destroy", self._done_upgrade) dlg.run("Sy") return
def empty_cache(self, wid, data=None): self._statusbar(_("Emptying cache...")) dlg = command_dialog(self.icon) dlg.connect("destroy", self._done) dlg.run("Scc") return
def clear_cache(self, wid, data=None): self._statusbar(msg=_("Clearing cache...")) dlg = command_dialog(self.icon) dlg.connect("destroy", self._done) dlg.run("Sc") return