Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=b0d2d08c446aeb4b005d1036216e1bf6ff187674

commit b0d2d08c446aeb4b005d1036216e1bf6ff187674
Author: bouleetbil <[email protected]>
Date:   Tue Jan 10 19:17:21 2012 +0100

pyfun
*init listore after system upgrade

diff --git a/py-pacman/pyfpm/src/pyfun.py b/py-pacman/pyfpm/src/pyfun.py
index 132e468..35da8b1 100644
--- a/py-pacman/pyfpm/src/pyfun.py
+++ b/py-pacman/pyfpm/src/pyfun.py
@@ -26,7 +26,8 @@ pyconfig=configuration()
suxcommande=pyconfig.Read('configuration','sux')
if suxcommande=="":
suxcommande="gksu"
-
+liststore = Gtk.ListStore(str,str,str)
+
class GUI:
def __init__(self):
#Global
@@ -42,16 +43,7 @@ class GUI:
self.window.set_title("PyFun : update packages")
self.window.set_size_request(400, 300)

-                       self.liststore = Gtk.ListStore(str,str,str)
-                       pacman_init()
-                       pacman_init_database()
-                       pacman_register_all_database()
-                       pkgs =[]
-                       pkgs = pacman_check_update()
-                       for pkg in pkgs:
-                               
self.liststore.append([pacman_pkg_get_info(pkg,PM_PKG_NAME),pacman_pkg_get_info(pkg,PM_PKG_VERSION),pacman_pkg_get_info(pkg,PM_PKG_DESC)])
-                       pacman_finally()
-
+                       init()
self.treeview =self.builder.get_object("treeview_pkg")
self.columnPkgname = Gtk.TreeViewColumn('Name')
self.columnDesc = Gtk.TreeViewColumn('Description')
@@ -77,7 +69,7 @@ class GUI:
self.treeview.set_search_column(0)
# on autorise la classement de la colonne
self.columnPkgname.set_sort_column_id(0)
-                       self.treeview.set_model(self.liststore)
+                       self.treeview.set_model(liststore)

self.window.show_all()

@@ -87,7 +79,18 @@ class GUI:

def on_BTN_update_clicked(*args):
sysexec(suxcommande+" python "+PYFPM_INST+" updatesys")
+               init()

+def init():
+               pacman_init()
+               pacman_init_database()
+               pacman_register_all_database()
+               pkgs =[]
+               pkgs = pacman_check_update()
+               for pkg in pkgs:
+                       
liststore.append([pacman_pkg_get_info(pkg,PM_PKG_NAME),pacman_pkg_get_info(pkg,PM_PKG_VERSION),pacman_pkg_get_info(pkg,PM_PKG_DESC)])
+               pacman_finally()
+
def main():
builder = Gtk.Builder()
builder.add_from_file(UI_SPLASH)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to