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

List:       kde-devel
Subject:    kate plugin / KTextEditor
From:       elho <eh1 () delair ! de>
Date:       2005-08-29 13:40:20
Message-ID: 43131044.5050506 () delair ! de
[Download RAW message or body]

I would like to use the kate plugin (KTextEditor) with python.

I translate from C++ where it works with 'Kate'. But in python it 
doesn't. What have I done wrong?

Problem is the last line:
editor = (KParts.Factory(factory)).createPart(self,'', None, '', 
"KTextEditor/Editor")
# ...after that   editor is 'NoneType'

in C++ it was:
editor = static_cast<KTextEditor::Editor*>(factory->createPart(NULL, 0, 
0, 0, "KTextEditor/Editor"));

---------------------------------------------------------------------------
offers = KTrader.self().query("text/html")
if len(offers) > 0 :
    for itKService in offers:
       if itKService.name() == "Embedded Advanced Text Editor" :
          ptr = itKService
    if ptr != None:
       strNameFile = "%s" % (QFile.encodeName(ptr.library()))
       factory = KLibLoader.self().factory(strNameFile)     # returns 
(KLibFactory)

editor = (KParts.Factory(factory)).createPart(self,'', None, '', 
"KTextEditor/Editor")

---------------------------------------------------------------------------
 
>> 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