diff Generic/fiebdc.py @ 5:6502bfdaa84d

update import durus database
author Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
date Sat, 06 Nov 2010 21:30:33 +0100
parents 2ac1551ad2ab
children 2fc6b47dbe70
line wrap: on
line diff
--- a/Generic/fiebdc.py	Sun Oct 31 23:12:06 2010 +0100
+++ b/Generic/fiebdc.py	Sat Nov 06 21:30:33 2010 +0100
@@ -1938,12 +1938,11 @@
                       recordStatistics(...)
         Return the budget objetc or None if the file can be readed
         """
-        if filename != None and  budget != None:
+        if not filename is None and not budget is None:
             self.__filename = filename
             self.__budget = budget
             self.__budget.filename = self.__filename
-        if self.__filename is None or self.__budget is None or \
-           self.__cancel == True:
+        if self.__filename is None or self.__budget is None or self.__cancel:
             return None
         if not os.path.exists(self.__filename):
             return None
@@ -2014,7 +2013,7 @@
         # beginning of the first registry “~” is ignored
         #"after_first_tilde" : "^[^~]*~"
         _buffer = self.__pattern["after_first_tilde"].sub("",_buffer)
-        while _buffer != "" and self.__cancel != True:
+        while _buffer != "" and not self.__cancel:
             #-# the blank characters (32), tabs (9) and end of line (13 and 10)
             # before the separators '~', '|' are erased.
             # Before separator \ not deleted because it affects the reading of
@@ -2035,7 +2034,7 @@
                                            _record_list[-1])
                 _last_record = ""
             for record in _record_list:
-                if self.__cancel == True:
+                if self.__cancel:
                     break
                 self.parseRecord(record)
             interface.progress(_file.tell() / _filesize)
@@ -2045,7 +2044,7 @@
                 _buffer2 = _buffer2.encode("utf8")
             _buffer = _last_record + _buffer2
         _file.close()
-        if self.__cancel == True:
+        if self.__cancel:
             print _("Cancelled process")
             return None
         else: