[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: kdeutils PyKDE dep [No module named dl]
From:       "=?ISO-8859-1?Q?Percy_Camilo_Trive=F1o_Aucahuasi?=" <orgyforever () gmail ! com>
Date:       2008-07-19 18:19:15
Message-ID: 579229230807191119g62022f01n466d7ef239df9dbc () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello there ; )

>if ARCH64:
>    import DLFCN as dl
>else:
>   import dl

Yep python should know the architecture, maybe that could be the solution.

I'm sending this post to kde-bindings mail list, I hope that someone can
explain this things better ; )

Best Regards
Percy



On Sat, Jul 19, 2008 at 8:11 AM, Teemu Rytilahti <tpr@d5k.net> wrote:

> Percy Camilo Triveño Aucahuasi kirjoitti viestissään (lähetysaika Friday 11
> July 2008):
> > Hi guys, when I was trying build "kdeutils", cmake couldn't find PyKDE4.
>
> Hi,
>
> > As far I know, this was a bug in python on x86_64 enviroments. I don't
> know
> > much about python, but maybe the SIP has generated this kind of code.
>
> Yup, I have also had the same problem using PyKDE4 bindings.
>
> > There is a way to solve this replace the code of
> > /usr/lib/python2.5/site-packages/PyKDE4/__init__.py
> > with this:
> >
> > #BEGIN
> > import sys
> > import ctypes
> > libc = ctypes.CDLL('libc.so.6')
> > libc.prctl(15, 'EntertainerBackend', 0, 0, 0)
> >
> > # This is needed to ensure that dynamic_cast and RTTI works inside
> kdelibs.
> > #sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> > #END
>
> I have modified my __init__.py according to some forum/wiki post to look
> like
> this and its working:
> #import sys, dl
> import sys
> import DLFCN as dl
> # This is needed to ensure that dynamic_cast and RTTI works inside kdelibs.
> sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
>
> No idea though which way that should be handled. If Python allows detecting
> the processor architecture when the app is run, perhaps something like this
> could be as a workaround in __init__.py:
>
> if ARCH64:
>    import DLFCN as dl
> else:
>    import dl
>
>
> Anyone in charge of PyKDE4 bindings around?
>
> > After that kdeutils found the PyKDE4 module, but this is the right
> > solution? this is a bug that concer the KDE scope?
> >
> > Cheers
> > Percy
> >
> > pd: System info:
> > - gcc (Debian 4.3.1-2) 4.3.1
> > - qt build from trunk/qt-copy (last update today)
> > - all KDE modules from trunk (last update today)
> > - PyQt build from sources (version 4.4.2)
> > - kdebindings/python already built
>
>
> --
> Best Regards,
> Teemu Rytilahti
>
>
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>

[Attachment #5 (text/html)]

<div dir="ltr">Hello there ; )<br><br>&gt;if ARCH64:<br>&gt;
 &nbsp;&nbsp; import DLFCN as dl<br>
&gt;else:<br>&gt;&nbsp;&nbsp; import dl<br><br>Yep python should know the \
architecture, maybe that could be the solution.<br><br>I&#39;m sending this post to \
kde-bindings mail list, I hope that someone can explain this things better ; ) <br> \
<br>Best Regards<br>Percy<br><br><br><br><div class="gmail_quote">On Sat, Jul 19, \
2008 at 8:11 AM, Teemu Rytilahti &lt;<a href="mailto:tpr@d5k.net">tpr@d5k.net</a>&gt; \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Percy Camilo Triveño Aucahuasi \
kirjoitti viestissään (lähetysaika Friday 11<br> July 2008):<br>
<div class="Ih2E3d">&gt; Hi guys, when I was trying build &quot;kdeutils&quot;, cmake \
couldn&#39;t find PyKDE4.<br> <br>
</div>Hi,<br>
<div class="Ih2E3d"><br>
&gt; As far I know, this was a bug in python on x86_64 enviroments. I don&#39;t \
know<br> &gt; much about python, but maybe the SIP has generated this kind of \
code.<br> <br>
</div>Yup, I have also had the same problem using PyKDE4 bindings.<br>
<div class="Ih2E3d"><br>
&gt; There is a way to solve this replace the code of<br>
&gt; /usr/lib/python2.5/site-packages/PyKDE4/__init__.py<br>
&gt; with this:<br>
&gt;<br>
&gt; #BEGIN<br>
&gt; import sys<br>
&gt; import ctypes<br>
&gt; libc = ctypes.CDLL(&#39;libc.so.6&#39;)<br>
&gt; libc.prctl(15, &#39;EntertainerBackend&#39;, 0, 0, 0)<br>
&gt;<br>
&gt; # This is needed to ensure that dynamic_cast and RTTI works inside kdelibs.<br>
&gt; #sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)<br>
&gt; #END<br>
<br>
</div>I have modified my __init__.py according to some forum/wiki post to look \
like<br> this and its working:<br>
#import sys, dl<br>
import sys<br>
import DLFCN as dl<br>
<div class="Ih2E3d"># This is needed to ensure that dynamic_cast and RTTI works \
inside kdelibs.<br> sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)<br>
<br>
</div>No idea though which way that should be handled. If Python allows detecting<br>
the processor architecture when the app is run, perhaps something like this<br>
could be as a workaround in __init__.py:<br>
<br>
if ARCH64:<br>
 &nbsp; &nbsp;import DLFCN as dl<br>
else:<br>
 &nbsp; &nbsp;import dl<br>
<br>
<br>
Anyone in charge of PyKDE4 bindings around?<br>
<div><div></div><div class="Wj3C7c"><br>
&gt; After that kdeutils found the PyKDE4 module, but this is the right<br>
&gt; solution? this is a bug that concer the KDE scope?<br>
&gt;<br>
&gt; Cheers<br>
&gt; Percy<br>
&gt;<br>
&gt; pd: System info:<br>
&gt; - gcc (Debian 4.3.1-2) 4.3.1<br>
&gt; - qt build from trunk/qt-copy (last update today)<br>
&gt; - all KDE modules from trunk (last update today)<br>
&gt; - PyQt build from sources (version 4.4.2)<br>
&gt; - kdebindings/python already built<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Best Regards,<br>
Teemu Rytilahti<br>
<br>
<br>
<br>
&gt;&gt; Visit <a href="http://mail.kde.org/mailman/listinfo/kde-devel#unsub" \
target="_blank">http://mail.kde.org/mailman/listinfo/kde-devel#unsub</a> to \
unsubscribe &lt;&lt;<br> </font></blockquote></div><br></div>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic