File tree Expand file tree Collapse file tree 4 files changed +24
-11
lines changed
Expand file tree Collapse file tree 4 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 55/dist /
66/pxpy.so
77/* .egg-info /
8+ /* .egg /
Original file line number Diff line number Diff line change @@ -81,12 +81,6 @@ cdef class Table:
8181 def getTableName (self ):
8282 return self .doc.getTableName()
8383
84- def getCodePage (self ):
85- """
86- Return the code page of the underlying Paradox table.
87- """
88- return self .doc.getCodePage()
89-
9084 def getTargetEncoding (self ):
9185 return self .doc.targetEncoding
9286
@@ -358,7 +352,6 @@ cdef class ParadoxField:
358352 cdef readonly flen
359353
360354 def __cinit__ (self , *args ):
361- # print 'ParadoxField cinit', args
362355 pass
363356
364357 def _init_fields (self , fname , int ftype , int flen ):
@@ -427,6 +420,14 @@ cdef class RecordField(ParadoxField):
427420 def __unicode__ (self ):
428421 return self .getValue()
429422
423+ def getName (self ):
424+ return self .fname
425+ name = property(getName)
426+
427+ def getType (self ):
428+ return self .ftype
429+ type = property(getType)
430+
430431 def getValue (self ):
431432 """
432433 Get the field's value.
@@ -563,7 +564,7 @@ cdef class RecordField(ParadoxField):
563564 pass
564565 elif self .ftype == pxfNumTypes:
565566 pass
566-
567+ value = property(getValue)
567568
568569cdef class Record:
569570 """
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ def run(self):
5151 ],
5252 zip_safe = False ,
5353 setup_requires = ["Cython>=0.13" ],
54+ tests_require = ["unittest2==0.5.1" ],
5455 ext_modules = [
5556 Extension ('pxpy' , ['pxpy.pyx' ],
5657 libraries = ['px' ]),
Original file line number Diff line number Diff line change 77# :Revision: $Revision: 1.2 $ by $Author: lele $
88# :Date: $Date: 2004/07/19 14:38:04 $
99#
10- import unittest
10+ import unittest2 as unittest
1111import os .path
1212import pxpy
1313
@@ -56,9 +56,19 @@ def test_blob_file(self):
5656 table .open ()
5757 table .setBlobFile (os .path .join (FIXTURE_DIR , 'KOMMENT.MB' ))
5858
59+ baptistene = table [0 ]
60+ field = baptistene [0 ]
61+ self .assertEqual (field .name , u"Aar" )
62+ self .assertEqual (field .value , u"2006" )
63+ self .assertEqual (field .type , 1 )
64+
65+ self .assertEqual (baptistene [1 ].value , u"BAPTI" )
66+ self .assertRegexpMatches (baptistene [3 ].value , r"^Statistikken inkluderer" )
67+
68+
5969 for record in table :
60- for field in record :
61- print field
70+ self . assertNotEqual ( record [ 3 ], "[MISSING BLOB FILE]" )
71+
6272
6373 table .close ()
6474
You can’t perform that action at this time.
0 commit comments