Paul McNett wrote: > FWIW, the kinterbasdb (3, 1, 2, 'final', 0) doesn't work with Dabo > currently, because: > > >>> kinterbasdb.init(type_conv=200) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/var/lib/python-support/python2.4/kinterbasdb/__init__.py", > line 313, in init > chosenTypeConvModuleName = typeConvOptions[type_conv] > KeyError: 200 > >>> > > I believe that the purpose of that type conversion was to use python's > datetime module instead of mx.DateTime. Because when I remove that: > > >>> kinterbasdb.init() > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/var/lib/python-support/python2.4/kinterbasdb/__init__.py", > line 315, in init > globalz, locals(), (chosenTypeConvModuleName,) > File > "/var/lib/python-support/python2.4/kinterbasdb/typeconv_backcompat.py", > line 17, in ? > from kinterbasdb import typeconv_datetime_mx > File > "/var/lib/python-support/python2.4/kinterbasdb/typeconv_datetime_mx.py", > line 35, in ? > from mx import DateTime as mxDT > ImportError: No module named mx > > I really don't want to install mx just to test with Firebird, and I > don't want to require our users to do that either. Any clues on what > alternative type_conv I can send? >
I think ubuntu has installed mx. Just tried under ubuntu, and it's there. Did you try to import mx in python? Anyway, we could test for an installed mx. But that's quit a lot of additional work. For the docs search for type_conv here: http://kinterbasdb.sourceforge.net/dist_docs/usage.html The kinterbasdb.init function takes a keyword argument type_conv, which controls KInterbasDB's initial choice of type translators. type_conv can be either an integer or an object that has all of the attributes named in kinterbasdb.BASELINE_TYPE_TRANSLATION_FACILITIES (an example of such an object is the module kinterbasdb.typeconv_backcompat). If type_conv is an integer, it will cause KInterbasDB to use one of the following predefined type translator configurations: type_conv integer "convenience code" Resulting translator configuration 0 Minimal type translators that represent date/time values as tuples and fixed point values as either floats or scaled integers, depending on the value of the deprecated Connection.precision_mode attribute. Unicode values are not encoded or decoded automatically. Implemented by the kinterbasdb.typeconv_naked module. 1 (the default) Backward-compatible type translators that represent date/time values via the mx.DateTime module and fixed point values as either floats or scaled integers, depending on the value of the deprecated Connection.precision_mode attribute. Unicode values are not encoded or decoded automatically. Implemented by the kinterbasdb.typeconv_backcompat module. This configuration, which is the default, perfectly mimics the type translation behavior of KInterbasDB 3.0. 100 This translator configuration, which is intended for use with Python 2.3 and later, represents date/time values via the standard library module datetime and fixed point values via the third-party fixedpoint module. Unicode values are encoded and decoded automatically (see this FAQ for more info). Implemented by the kinterbasdb.typeconv_23plus module. 200 (the ideal) This translator configuration represents date/time values via the standard library module datetime and fixed point values via the decimal module. The decimal module entered the standard library in Python 2.4, but can also be manually installed in Python 2.3. Unicode values are encoded and decoded automatically (see this FAQ for more info). Implemented by the kinterbasdb.typeconv_24plus module. 199 This translator configuration is exactly like 200, except that it represents fixed point values as float objects in order to avoid the substantial memory overhead of the decimal module. It is fundamentally imprecise to represent fixed point values in floating point, so this convenience code is intended solely for users who wish to use datetime instead of mx.DateTime, but don't care about fixed point values and don't want to suffer the memory overhead of the decimal module. Implemented by the kinterbasdb.typeconv_23plus_lowmem module. _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
