Closed pythonmobile closed 10 years ago
Regarding the Python installation: I'll just note for future reference that open issues #4 and #13 are also related. We'll need to discuss internally how high a priority this should be before I can comment any further.
The error output of the unit tests is generated by the wgdb library. It is supposed to do it in this case. The test is checking whether an error is raised on invalid input. The library level error messages can be suppressed, if they become annoying. Generally this is not an issue in a user application.
I can't think of any key-value example available online. Off the top of my head, I'd create an index on column 0 using indextool
, then add data using d.insert((key, value))
and find it
using
c=d.cursor()
c.execute(matchrec=[key])
c.fetchone()[1]
where d
is the database object.
I should probably add that the above example does not make sure the keys are unique. So a slightly improved version would be something like this:
def kvget(d, k):
c=d.cursor()
c.execute(matchrec=[k])
r=c.fetchone()
c.close()
if r is None: return None
else: return r[1]
def kvset(d, k, v):
c=d.cursor()
c.execute(matchrec=[k])
r=c.fetchone()
c.close()
if r is None: d.insert((k, v))
else: r[1]=v
@priitj Thanks.
Can we please get pip/easy_install support on windows, preferably with pre-compiled libraries so that the setup does not need Visual C++ compiler setup.
Also:
................wg data handling error: wrong field number given to wg_set_field
.
Ran 17 tests in 1.137s
OK