[gevice] Fixed bug #690185



commit 92b3f079621613c44204dc980d42a7f58ac7a0d6
Author: Alejandro ValdÃs Jimenez <avaldes gnome org>
Date:   Fri Dec 28 18:18:39 2012 -0300

    Fixed bug #690185

 ChangeLog             |    5 +++++
 src/gevice.py         |    2 --
 src/gevicedatabase.py |   21 ++++-----------------
 3 files changed, 9 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 51c8727..d26ed49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 2012-12-28  Alejandro Valdes Jimenez  <avaldes gnome org>
+	* src/gevice.py:
+	* src/gevicedatabase.py:
+	* Fixed bug #690185
+
+2012-12-28  Alejandro Valdes Jimenez  <avaldes gnome org>
 	* data/other/testing.db:
 	* src/gevice.py: set paned position.
 
diff --git a/src/gevice.py b/src/gevice.py
index 582e581..4a743f0 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -402,10 +402,8 @@ class Gevice:
         self.gdbase.insert_connections(connected)    
     
     if (self.gdbase.get_status_sql()):
-      self.gdbase.apply_commit()
       result = self.show_infobar_message (_("Model saved"), Gtk.MessageType.INFO)
     else:
-      self.gdbase.apply_rollback()
       result = self.show_infobar_message (self.gdbase.get_error(), Gtk.MessageType.ERROR)
 
   def copy_device_to_dbase (self,model,path,iter,data):
diff --git a/src/gevicedatabase.py b/src/gevicedatabase.py
index f3fa73e..4c3b09e 100644
--- a/src/gevicedatabase.py
+++ b/src/gevicedatabase.py
@@ -85,20 +85,6 @@ class GeviceDatabase:
     """
     return self.__error_string
 
-  def apply_commit(self):
-    """
-    Apply commit.
-    """
-    self.__conn.commit()
-    print "commit()"
-  
-  def apply_rollback(self):
-    """
-    Rollback transactions.
-    """
-    self.__conn.rollback()
-    print "rollback()"
-
   def get_status_sql(self):
     """
     Return status of SQL executed.
@@ -132,7 +118,7 @@ class GeviceDatabase:
 
   def file_is_valid(self):
     """
-    Return if file is a valid sqlite3. 
+    Return if file is a valid sqlite3.
     """
     return self.__valid_file
 
@@ -242,9 +228,10 @@ class GeviceDatabase:
     """
     self.__status_sql = False
     
-    try:      
+    try:
       self.__cur.execute(sql)
       self.__status_sql = True
     except sqlite3.Error as e:
-      print "An error occurred -----:", e.args[0]
+      self.__conn.rollback()
+      print "An error occurred: ", e.args[0]
       self.__error_string = e.args[0]



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