From kde-bindings Sun Dec 28 15:12:47 2008 From: Luca Beltrame Date: Sun, 28 Dec 2008 15:12:47 +0000 To: kde-bindings Subject: [Kde-bindings] Python DataEngine problem Message-Id: <200812281612.54095.einar () heavensinferno ! net> X-MARC-Message: https://marc.info/?l=kde-bindings&m=123047723117940 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0446100918==" --===============0446100918== Content-Type: multipart/signed; boundary="nextPart29301552.q8x6I6Vd8f"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart29301552.q8x6I6Vd8f Content-Type: multipart/mixed; boundary="Boundary-01=_vd5VJwFeECXlGlZ" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_vd5VJwFeECXlGlZ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, I've been starting to play with Plasma and Python (KDE 4.2 beta 2), and I'v= e=20 been trying to create a simple DataEngine. I wonder if these should be=20 installed as packages, with plasmapkg, or with something else, because I ca= n't=20 seem to get them to work in the engine explorer.=20 I always get these errors: Traceback (most recent call last): = = =20 File "/usr/share/kde4/apps/plasma_scriptengine_python/pydataengine.py", l= ine=20 43, in init = =20 self.module =3D __import__(self.plugin_name+'.main') = = =20 ImportError: No module named main = = =20 Traceback (most recent call last): = = =20 File "/usr/share/kde4/apps/plasma_scriptengine_python/pydataengine.py", l= ine=20 58, in sources = =20 return self.pydataengine.sources() = = =20 AttributeError: pydataengine = = =20 Traceback (most recent call last): = = =20 File "/usr/share/kde4/apps/plasma_scriptengine_python/pydataengine.py", l= ine=20 64, in sourceRequestEvent = =20 return self.pydataengine.sourceRequestEvent(name) = = =20 AttributeError: pydataengine My main.py and metadata.desktop files are attached, but it must be noted th= at=20 this happens also with the sample DataEngine code present in SVN=20 (plasma_dataengine_pytime; exactly the same error). Is there anything I'm doing wrong, or is there a bug? I apologize in advance if the quality of the code is rather crude, I was ju= st=20 trying an experiment. Thanks! P.S.: Please CC me in replies, I'm not subscribed. --Boundary-01=_vd5VJwFeECXlGlZ Content-Type: text/x-python; charset="UTF-8"; name="main.py" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="main.py" #!/usr/bin/env python from PyQt4.QtCore import * from PyKDE4.kdecore import * from PyKDE4 import plasmascript from Bio import Entrez # querying functions class PyEUtilsEngine(plasmascript.DataEngine): def __init__(self, parent, args=None): plasmascript.DataEngine.__init__(self, parent) def init(): Entrez.email = "testa_testa@graffiti.net" self.setMinimumPollingInterval(3000) # To comply with NCBI regulations def sources(self): sources = ["NCBI"] return sources def sourceRequestEvent(self, name): return updateSourceEvent(name) def updateSourceEvent(self, gene): handle = Entrez.esearch(name, db="gene") data = Entrez.read(handle) idlist = data["IdList"] self.setData("Genes",QVariant(idlist)) return True def CreateDataEngine(parent): return PyEutilsEngine(parent) --Boundary-01=_vd5VJwFeECXlGlZ Content-Type: application/x-desktop; name="metadata.desktop" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="metadata.desktop" [Desktop Entry] Name=Python EUtils Comment=DataEngine for NCBI's EUtils Type=Service Icon=preferences-system-time ServiceTypes=Plasma/DataEngine X-Plasma-API=python X-KDE-PluginInfo-Author=Luca Beltrame X-KDE-PluginInfo-Email=einar@heavensinferno.net X-KDE-PluginInfo-Name=plasma-python-eutils-dataengine X-KDE-PluginInfo-Version=0.0.1 X-KDE-PluginInfo-Website=http://www.dennogumi.org X-KDE-PluginInfo-Category=EUtils X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true --Boundary-01=_vd5VJwFeECXlGlZ-- --nextPart29301552.q8x6I6Vd8f Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAklXl3YACgkQmnRxFtM0wqQ5vgCfa1qyNjEt8/vprppYwc0a/wPP qasAn2Xa1iq0u9n5bheLEr1ZHsepBngw =nNnZ -----END PGP SIGNATURE----- --nextPart29301552.q8x6I6Vd8f-- --===============0446100918== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-bindings mailing list Kde-bindings@kde.org https://mail.kde.org/mailman/listinfo/kde-bindings --===============0446100918==--