[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7689 - trunk/gnue-common/src/utils
From: |
johannes |
Subject: |
[gnue] r7689 - trunk/gnue-common/src/utils |
Date: |
Wed, 6 Jul 2005 08:14:12 -0500 (CDT) |
Author: johannes
Date: 2005-07-06 08:14:11 -0500 (Wed, 06 Jul 2005)
New Revision: 7689
Modified:
trunk/gnue-common/src/utils/dbf.py
Log:
Transfor empty fields to python's None value
Modified: trunk/gnue-common/src/utils/dbf.py
===================================================================
--- trunk/gnue-common/src/utils/dbf.py 2005-07-06 13:06:21 UTC (rev 7688)
+++ trunk/gnue-common/src/utils/dbf.py 2005-07-06 13:14:11 UTC (rev 7689)
@@ -197,8 +197,12 @@
raw = stream [cpos:cpos + flen]
cpos += flen
+ # Is the field empty ?
+ if not raw.strip ():
+ value = None
+
# Numeric conversion
- if ftype == 'N':
+ elif ftype == 'N':
if fdec:
value = float (raw.split ('\x00', 1) [0].strip () or 0)
else:
@@ -268,7 +272,7 @@
if __name__ == '__main__':
- dbfile = dbf ('/home/johannes/dat_cli.dbf')
+ dbfile = dbf ('/home/johannes/checkit.dbf')
print "STATs:"
print " Signature:", dbfile.signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7689 - trunk/gnue-common/src/utils,
johannes <=