Re: Reports from DBF Files (2)

"Karl M. Joch" <[email protected]>
Newsgroups gmane.comp.gnu.enterprise.general
Message-ID <[email protected]>
Karl M. Joch wrote:

 > Hello,
 >
 > Reinhard Mueller wrote:
 >
 >> Hello,
 >>
 >> it's very nice to see you here on this list, and I've always wanted to
 >> thank you for creating the FreeBSD ports for GNUe!
 >>
 >
 > Not a problem, I am really interested in GNUE so I was interested to 
see it working on FreeBSD.
 >
 >> Am Mit, den 25.08.2004 schrieb Karl M. Joch um 1:06:
 >>
 >>> Trying to create some reports on FreeBSD from Clipper/DBF Files.
 >>
 >>
 >>
 >>
 >> The dbf dbdriver for gnue is based on an external python dbf library
 >> which also has to be installed.
 >>
 >> Our project member Jan Ischebeck has has created this driver, and AFAIK
 >> noone else of the gnue team has ever used it. Unfortunately, we haven't
 >> heard from Jan lately, as he seems to be busy with real life.
 >>
 >> We have tried to find out what external python dbf library he has used,
 >> and all we found out is that it's *not* http://www.fiby.at/dbfpy/ :-(
 >>
 >> Maybe Jan sees this mail and can help us. Or maybe somebody else has
 >> managed to make dbf run.
 >>
 >> If you really think it would be wort the effort, we could also create a
 >> new driver that is based on the fiby module mentioned above. For this,
 >> it would be interesting how others see the need for a dBase compatible
 >> dbdriver for GNUe.
 >>
 >> Thanks,
 >
 >
 >
 > I searched and found 3 things:
 >
 > http://schwinger.harvard.edu/~mspal/pystuff/dbf.txt
 > http://mail.python.org/pipermail/python-list/2001-July/053128.html
 > http://lists.maptools.org/pipermail/shapelib/2004-May/000076.html
 >
 > it looks ilke to me that the first one could be the neccecary module. 
I will try it soon, but finally this one has no support for index files. 
In the first step i would like to add some reports to an very old 
application we are running. without indexes dbf access makes no real 
sence. I still havnt found the time to start moving away from 
Clipper/Harbour. Application is very complex :-( .
 >
 >

imported dbf.py from schwinger.harvard.edu to /sur/local/lib/python.2.3

module itself works:

thon 2.3.4 (#2, Jun 19 2004, 00:27:41)
[GCC 3.3.3 [FreeBSD] 20031106] on freebsd5
Type "help", "copyright", "credits" or "license" for more information.

 >>>>>> import dbf
 >>>>>> db = dbf.dbf('/tmp/kunden.dbf')
 >>>>>> db.open()
 >>>>>> from string import strip
 >>>>>> for k in db:


... print "%s, %s" % (strip(k[1]), strip(k[2]))
   File "<stdin>", line 2
     print "%s, %s" % (strip(k[1]), strip(k[2]))
         ^
IndentationError: expected an indented block

 >>>>>> for k in db: print "%s, %s" % (strip(k[1]), strip(k[2]))


...
J, 0002001
N, 0004001
N, 0004002
N, 0004003
N, 0049999
N, 0050000
J, 0050001
N, 0010000
N, 0010001
N, 0010002

 >>>>>>

But again error. I am not very familiar with Python and there is a todo
note in connections.py regarding DataObject and Static definition.

DB000: Traceback (most recent call last):
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/designer/base/MenuBar.py",
line 143, in <lambda>
DB000:     lambda event, l=self.instance, e=action, x=eventdata:
l.dispatchEvent(e, **x))
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/common/events/EventController.py",
line 111, in dispatchEvent
DB000:     handler(event)
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/designer/base/Instance.py",
line 581, in __OnConnectTo
DB000:     tempDO = self.connections.getDataObject(conn, 'object')
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/common/datasources/GConnections.py",
line 292, in getDataObject
DB000:     connection = self.getConnection(connection_name)
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/common/datasources/GConnections.py",
line 245, in getConnection
DB000:     'Connection')
DB000:   File
"/usr/local/lib/python2.3/site-packages/gnue/common/apps/plugin.py",
line 168, in find
DB000:     raise LoadError, (name, result)
DB000: gnue.common.apps.plugin.LoadError: Cannot load plugin dbf
DB000: The following plugins failed:
DB000: * gnue.common.datasources.drivers.dbf.dbf: NameError: name
'DataObject' is not defined
DB000:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.