Jppy: 0.0.33 is ready

Nicholas Piper nick-jppy at nickpiper.co.uk
Tue Oct 24 19:59:41 BST 2006


Norbert,

On Tue, 24 Oct 2006, Norbert Preining wrote:

> On Die, 24 Okt 2006, Nicholas Piper wrote:
> > nicholas at piamox7:~$ python
> > >>> import jppy
> > >>> len(jppy.memo32List().records())

> [~] python
> Python 2.4.4 (#2, Oct 20 2006, 00:23:25) 
> [GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import jppy
> >>> len(jppy.memo32List().records())
> 23
> >>> 

> So not many. And the length is not exorbitant of the files.

I've spent a while profiling (and the longest time was working out how
to profile the C level of a python shared library module!).

It is slow because of pyuca - the unicode sorting system, combined
with the length of the memos. I sort on the entire memo...

I've added a ~/.jppyrc option to disable this:

[core]
unicode-collation = no

and now it is much faster. The GUI is still slow to manipulate long
memo's though. You can fetch r151 to try this.

I guess it's back to the drawing board with respect to the unicode
sorting! I could have it sort on just the first 15 or so bytes,
maybe. That's in r152; and seems a good compromise.

> In fact the execution of the above was VERY fast! Is there a way to
> read the stuff in from python cmdline? I am a python idiot ;-)

For memos:

In [1]:import jppy
In [2]:first_memo = jppy.memoList().records()[0]
In [3]:first_ten_bytes = first_memo['text'][0:10]
In [4]:first_memo.category
Out[4]:6
In [6]:jppy.memoList().getCategories()[6]
Out[6]:u'DATEBK3'

etc. If you have a particular 'job' you'd like, let me know and I'll
write an example for the examples directory.

 Nick

-- 
Nick Piper, Developer, LogicaCMG           http://www.nickpiper.co.uk/
GPG Encrypted mail welcome!                             1024D/3ED8B27F
Choose life. Be Vegan :-) Please reduce needless cruelty + suffering !




More information about the Jppy mailing list