You Are Here:

Community: Developer Discussion Boards

#1 Old [announce] cElementTree for pys60 *alpha* - 2006-03-09, 20:11

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
Hello,

This package contains pys60 build of cElementTree (http://effbot.org/zone/element-index.htm) .

The package enables xml parsing and processing.

The installation .sis contains the cElementTree and elementtree-package. Not very much tested, be warned.

http://pymbian.sourceforge.net/misc/...ree-v1.0.5.SIS

Source release has the required files to build your own version. It also has 2nd ed fp2 emulator binary. No source codes were modified, only files required for symbian build were added.
http://pymbian.sourceforge.net/misc/...s60-v1.0.5.zip

Look for elementtree page for more info. Here is quick example:
Code:
>>> import cElementTree as et
>>> e=et.fromstring("<hello>world</hello>")
>>> e.tag, e.text
('hello', 'world')
BEWARE: This c++ extensions is build with so called "statichack" technique (http://pymbian.sourceforge.net/misc/statichack/). It uses EPOCDATALINKADDRESS=0x30000000. If you use another python extensions that is made with this technique and has same address things will not work!

UPDATE 2006-03-10:
cElementTree was upgraded, some minor improvements. Nothing critical, but you should get this version. Also, the source release is better organized now.
SIS: http://pymbian.sourceforge.net/misc/...060310-r90.SIS
src: http://pymbian.sourceforge.net/misc/...060310-r90.zip

See details here: http://svn.effbot.python-hosting.com...nttree/CHANGES

UPDATE 2006-05-03:
Please be aware that this component eats memory quite much, something like 1.5 MB.

UPDATE 2006-09-25:
Installation for 3rd ed: http://ssalmine.googlepages.com/pys6....20060925.sisx
Source for 3rd ed: https://svn.sourceforge.net/svnroot/...enttree/trunk/
Last edited by simo.salminen : 2006-09-25 at 19:42. Reason: info about memory usage
Reply With Quote

#2 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-03-09, 20:52

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Great day today ! :-)

Bravo Samo !
Reply With Quote

#3 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-03-10, 04:25

Join Date: Jan 2005
Posts: 148
Location: Bangkok, Thailand
Send a message via MSN to korakotc
korakotc's Avatar
korakotc
Offline
Regular Contributor
We are all helping create the building blocks.

cElementTree is a crucial part indeed, Thanks! Simo.
Reply With Quote

#4 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-03-15, 07:19

Join Date: Feb 2006
Posts: 23
aymanshamma
Offline
Registered User
Great! Thanks Simo.

Sadly, I can't get the simple example in this thread to work inside the emulator.

I copied the files in the distribution to their respective locations:

C:\Symbian\8.0a\S60_2nd_FP2\epoc32\release\armi\urel\CELEMENTTREE.PYD
C:\Symbian\8.0a\S60_2nd_FP2\epoc32\release\wins\udeb\z\system\Libs\CELEMENTTREE.PYD

For example:

Code:
>>> import cElementTree as et
>>> et
<module 'cElementTree' from 'Z:\system\libs\cElementTree.pyd'>
>>> e = et.fromstring("<a>b</a>")
Traceback (most recent call last):
 File "<console>", line 1 in ?
AttributeError: 'module' object has no attribute 'fromstring'
Other functions seem to work like:
Code:
>>> et.Element("foo")
<Element 'foo' at 0x1ab578b8>
Did I miss an install step?

-a.
Reply With Quote

#5 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-03-15, 12:32

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
Sorry, forgot to document that. The source package contains elementtree package (pure python code) in elementtree directory. Move that directory to C:\Symbian\8.0a\S60_2nd_FP2\epoc32\release\wins\udeb\z\system\Libs\elementtree\.

When you import the cElementTree module, it will load code from that package (including that fromstring implementation).

The .sis package contains also the elementtree module, so it works in terminal right away.
Reply With Quote

#6 Old Smile Re: [announce] cElementTree for pys60 *alpha* - 2006-03-15, 20:29

Join Date: Feb 2006
Posts: 23
aymanshamma
Offline
Registered User
Great! Thanks again Simo.

-a.
Reply With Quote

#7 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-07, 22:09

Join Date: Oct 2006
Posts: 24
andersnc
Offline
Registered User
Quote:
Originally Posted by simo.salminen
I realize I'm resurrecting a pretty old thread here, but it seems that between this release and now, something changed and this package is now broken.

I've got the latest S60 Python release (1.3.15), signed with a dev cert specifically for this handset (the free one). Running the simple test script:

Code:
import cElementTree as et

e=et.fromstring("<hello>world</hello>")
print e.tag, e.text
This dies with a KErrPermissionDenied during the import when trying to access c:\sys\bin\_cElementTree.pyd. I tried resigning the package with my own dev cert and it the same error occurs. Am I missing something obvious or did something else change that broke this?

What I'm really looking for is basic XML parsing that will working on a 3rd Ed. device (N80). The pyexpat and other ports all seems to be 1st and 2nd Ed. only. If someone has a pointer to XML parsing stuff that works on an N80, that would pretty much make my day. Thanks in advance for any information.
Reply With Quote

#8 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-09, 20:01

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Andernsc try this for 3rd (you have the choice signed or unsigned !)

pys60 cElementTree for 3rd (selfsigned)
pys60 cElementTree for 3rd (unsigned)


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#9 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-11, 20:22

Join Date: Oct 2006
Posts: 24
andersnc
Offline
Registered User
Great, thanks cyke64!

As a note, the self-signed one still died running the above test script with the same KErrPermissionDenied error. However, signing the other with my dev cert worked fine. Perhaps there's something in there that requires more permissions than self-signing grants...?

Regardless, thanks for updated packages. Just out of curiosity, what needed to be changed? I didn't really have time to go mining in the source, but I'll admit feeling a silly if it was something simple. Cheers!
Reply With Quote

#10 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-12, 13:56

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
Hi andersnc,

If I'm not mistaking (could be ), if you install PyS60 with a free developer certificate, you need to sign all your .sis with the same certificate.

To be confirmed

LFD


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#11 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-12, 16:02

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by lfd
Hi andersnc,

If I'm not mistaking (could be ), if you install PyS60 with a free developer certificate, you need to sign all your .sis with the same certificate.

To be confirmed

LFD
hello lfd ,

It's not confirmed
If you have installed the PyS60 with a free developer cert you don't need to sign all your Python S60 app (.sisx) with the same cert only the sisx files containing extension module .pyd !!!
the Python application as pyedit 0.13 work like a charm with sisx selfsigned

JPLauril said :
"Scripts that require capabilities will have to be packaged as standalone applications and distributed as a SIS package. The capabilities of the script will the capabilities of the stub EXE file included in the SIS that runs the Python interpreter. It is the responsibility of the script writer to ensure that the application loads only code that they have verified to be safe.

Python relies entirely on the native Platsec security model.
In a sense, the Python interpreter is just a helper DLL that your native stub EXE loads to help it do its job".


and bhima said :
"Also, if you install any .PYD documents (which are included in SISX files when you use them on the 3rd edition), they will _also_ need to be signed with appropriate permissions. My own, custom developer-signed Python installation won't let me run 3rd party Python extensions unless I sign them with enough permission."

I hope that it is clearer now


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#12 Old Re: [announce] cElementTree for pys60 *alpha* - 2006-12-12, 20:04

Join Date: Oct 2006
Posts: 24
andersnc
Offline
Registered User
Slightly confusing, but I think I get it Thanks again for the explanations.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
[announce] s60pyrex alpha simo.salminen Python 7 2008-01-10 01:45
[announce] vibra.pyd and music.pyd modules cyke64 Python 3 2007-08-13 04:17
[announce] pys60usb - usb connectivity for s60/python simo.salminen Python 6 2006-04-19 14:49
[announce] Mastermind game cyke64 Python 6 2006-03-09 14:15
[Announce] GPSDisplay cyke64 Python 0 2006-01-23 16:40

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia