[gevice] add functions for get lists of type of device and marks



commit b16e2c050dc1893c06504e21232f4c42c3c4563b
Author: Alejandro Valdes Jimenez <avaldes lenny utalca cl>
Date:   Tue May 12 18:13:52 2009 -0400

    add functions for get lists of type of device and marks
---
 src/gevicedatabase.py |   46 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/src/gevicedatabase.py b/src/gevicedatabase.py
index d95d9cd..663a625 100644
--- a/src/gevicedatabase.py
+++ b/src/gevicedatabase.py
@@ -34,7 +34,6 @@ class GeviceDatabase:
 
 
     def execute_sql_select (self,gevice,sql):
-        print sql
         try:
             self.cur.execute(sql)
             rows = self.cur.fetchall()
@@ -44,7 +43,6 @@ class GeviceDatabase:
             return False
         
     def execute_sql_insert (self,gevice,sql):
-        print sql
         try:
             self.cur.execute(sql)
             return True
@@ -53,7 +51,6 @@ class GeviceDatabase:
             return False
             
     def execute_sql_delete (self,gevice,sql):
-        print sql
         try:
             self.cur.execute(sql)
             return True
@@ -62,7 +59,6 @@ class GeviceDatabase:
             return False
 
     def execute_sql_update (self,gevice,sql):
-        print sql
         try:
             self.cur.execute(sql)
             return True
@@ -258,9 +254,7 @@ class GeviceDatabase:
     
     
     def get_list_of_links (self,gevice):
-        liststore = gtk.ListStore(
-            gobject.TYPE_STRING,
-            gobject.TYPE_INT)
+        liststore = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_INT)
             
         sql = "select nom_tipo_enlace,id_tipo_enlace from tipo_enlace"
         
@@ -277,3 +271,41 @@ class GeviceDatabase:
             return liststore
         else:
             return False
+
+    def get_list_of_type (self,gevice):
+        liststore = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_INT)
+            
+        sql = "select nom_tipo_disp,id_tipo_disp from tipo_disp"
+        
+        rows = self.execute_sql_select(gevice,sql)
+        
+        if rows:
+            for row in rows:
+                iter = liststore.append ()
+                liststore.set (
+                    iter,
+                    0,row[0],
+                    1,row[1])        
+                                
+            return liststore
+        else:
+            return False
+
+    def get_list_of_mark (self,gevice):
+        liststore = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_INT)
+            
+        sql = "select nom_marca,id_marca from marca"
+        
+        rows = self.execute_sql_select(gevice,sql)
+        
+        if rows:
+            for row in rows:
+                iter = liststore.append ()
+                liststore.set (
+                    iter,
+                    0,row[0],
+                    1,row[1])
+                           
+            return liststore
+        else:
+            return False



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]