| Reply | « Previous Thread | Next Thread » |
|
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')
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
|
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Great day today ! :-)
Bravo Samo ! |
|
We are all helping create the building blocks.
cElementTree is a crucial part indeed, Thanks! Simo. |
|
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'
Code:
>>> et.Element("foo")
<Element 'foo' at 0x1ab578b8>
-a. |
|
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. |
| simo.salminen |
| View Public Profile |
| Find all posts by simo.salminen |
|
Great! Thanks again Simo.
-a. |
|
Quote:
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
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. |
|
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/ |
|
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! |
|
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 |
|
Quote:
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/ |
|
Slightly confusing, but I think I get it
Thanks again for the explanations. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |