[PyKDE] KMimeType.findByPath return value
jbublitz at nwinternet.com
Thu Jan 2 22:16:00 GMT 2003
On 02-Jan-03 Daniel Naber wrote:
> On Thursday 02 January 2003 01:56, you wrote:
>> KServiceTypeProfile.preferredService takes a QString as its
>> argument, so you should use "mimetype" instead of "mimestr".
> Then the offer is None, even for things like text/html. If I ask
> for offers
> for "text/html" (<- as a python string), I get the problem
> described in
> the mail before, i.e. the broken result of name().
>> offer.name(). I was using an older value of PyKDE which didn't
>> use findByPath, so that may have been my problem.
> findByPath() and findByURL() doesn't make a difference for me
> regarding this problem.
I get the same problem - name() is an empty string, while isValid()
returns True. I also get None for library(), but type() returns
correctly. Also note that in PyKDE, exec() was not renamed (it
clashes with the Python keyword), so it's not accessible.
Can you use KTrader instead? There is a simple example in
examples/pyParts.py, and more complete docs in the KDE class
reference (kio - KTrader). At the moment I can't tell if the
problem is with KDE or PyKDE, and I'm going to be pretty backed up
for a while. I'll spare you the gory details, but I'm about ready
If you can try an equivalent C++ version, that would be helpful.
Otherwise I'll try to sort it out as soon as I can get to it. The
only other thing I can think of is that the blank name has
something to do with KSycoca, but I have no idea what. Beyond that,
it's an error in code someplace but may take some time to find out
Sorry I can't be more helpful at the moment.
More information about the PyQt