[Eric] Re: Error at startup item "Generate Dialog Code ..."

Сергей Гринько sergey.grinko at gmail.com
Tue Jun 16 12:38:51 BST 2009


Offer amuse the problem this way:
The file ProjectFormsBrowser.py method __generateDialogCode class
ProjectFormsBrowser add a change to the current directory to open a file -
'fn' -> os.chdir (os.path.dirname (os.path.abspath (fn)))

import os
...
class ProjectFormsBrowser (ProjectBaseBrowser):
     ...
     def __generateDialogCode (self):
         "
         Private method to generate dialog code for the form (Qt4 only)
         "
         itm = self.model (). item (self.currentIndex ())
         fn = unicode (itm.fileName ())

         if self.hooks [ "generateDialogCode"] is not None:
             self.hooks [ "generateDialogCode"] (filename)
         else:
             from CreateDialogCodeDialog import CreateDialogCodeDialog
             # In 915 line add:
             # Change directory to local place for file "fn"
             os.chdir (os.path.dirname (os.path.abspath (fn)))
             dlg = CreateDialogCodeDialog (fn, self.project, self)
             if not dlg.initError ():
                 dlg.exec_ ()

Following these changes, all is well.


10 июня 2009 г. 13:39 пользователь Сергей Гринько
<sergey.grinko at gmail.com>написал:

> Structure folder/files:
> project/
>        UI/
>          widgets/
>               plugins/
>                   QLineEditWErrState_plugin.py
>                         __init__.py
>               qlineeditwerrstate.py
>        erredit.ui
>        __init__.py
>        Ui_erredit.py
>
> if run <<Ui_erredit.py>> clicked <<Run Script>> - all Ok!
>
> On rightclick <<erredit.ui>> and case <<Generate Dialog Code...>> errors:
>
> Warning:
> An unhandled exception occurred. Please report the problem
> using the error reporting dialog or via email to <
> eric4-bugs at die-offenbachs.de>.
> A log has been written to "/home/grinko/.eric4/eric4_error.log".
> Error information:
>
> --------------------------------------------------------------------------------
> 2009-06-10, 13:01:43
>
> --------------------------------------------------------------------------------
> <type 'exceptions.ImportError'>:
> No module named widgets.qlineeditwerrstate
>
> --------------------------------------------------------------------------------
> File
> "/usr/lib/python2.5/site-packages/eric4/Project/ProjectFormsBrowser.py",
> line 915, in __generateDialogCode
> dlg = CreateDialogCodeDialog(fn, self.project, self)
> File
> "/usr/lib/python2.5/site-packages/eric4/Project/CreateDialogCodeDialog.py",
> line 92, in __init__
> self.__updateSlotsModel()
> File
> "/usr/lib/python2.5/site-packages/eric4/Project/CreateDialogCodeDialog.py",
> line 163, in __updateSlotsModel
> dlg = uic.loadUi(self.formFile)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/__init__.py", line 106, in
> loadUi
> return loader.DynamicUILoader().loadUi(uifile, baseinstance)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/Loader/loader.py", line
> 22, in loadUi
> return self.parse(filename)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 690, in
> parse
> actor(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 538, in
> createUserInterface
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 163, in
> createWidget
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 163, in
> createWidget
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 320, in
> createLayout
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 340, in
> handleItem
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 320, in
> createLayout
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 340, in
> handleItem
> self.traverseWidgetTree(elem)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 516, in
> traverseWidgetTree
> handler(self, child)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 157, in
> createWidget
> self.stack.push(self.setupObject(widgetClass(elem), parent, elem))
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/uiparser.py", line 130, in
> setupObject
> obj = self.factory.createQObject(clsname, name, args, is_attribute)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/objcreator.py", line 64,
> in createQObject
> classType = self.findQObjectType(classname)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/objcreator.py", line 74,
> in findQObjectType
> w = module.search(classname)
> File "/usr/lib/python2.5/site-packages/PyQt4/uic/Loader/qobjectcreator.py",
> line 50, in search
> self._modules[module] = __import__(module, {}, {}, (cls,))
>
> --------------------------------------------------------------------------------
> Version Numbers:
> Python 2.5.2
> Qt 4.4.3
> PyQt4 4.4.4
> sip 4.7.9
> QScintilla 2.2
> eric4 4.3.4 (r3192)
> Platform: linux2
> 2.5.2 (r252:60911, Sep 29 2008, 21:10:35)
> [GCC 4.3.2]
>
> --------------------------------------------------------------------------------
> Plugins Version Numbers:
> PluginAbout 4.3.0
> PluginAssistantEric 1.2.1
> PluginCharTables 4.1.4
> PluginCxFreeze 4.2.0
> PluginEricapi 4.3.0
> PluginEricdoc 4.3.0
> PluginProjectDjango 2.1.0
> PluginProjectPylons 1.0.0
> PluginProjectTurboGears 1.0.5
> PluginProjectWxPython 1.0.3
> PluginPyLint 4.1.3
> PluginRefactoringRope 1.1.5
> PluginSyntaxChecker 4.2.0
> PluginTabnanny 4.2.0
> PluginVcsCVS 4.1.11
> PluginVcsPySvn 4.3.0
> PluginVcsSubversion 4.3.0
> PluginVmListspace 4.2.0
> PluginVmMdiArea 1.0.0
> PluginVmTabview 4.3.0
> PluginVmWorkspace 4.2.0
> PluginWizardPyRegExp 4.2.0
> PluginWizardQColorDialog 4.2.0
> PluginWizardQFileDialog 4.2.0
> PluginWizardQFontDialog 4.2.0
> PluginWizardQInputDialog 4.2.0
> PluginWizardQMessageBox 4.2.0
> PluginWizardQRegExp 4.2.0
>
>
>


-- 
С уважением Гринько Сергей
Email: sergey.grinko at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/eric/attachments/20090616/0e2bc590/attachment.html


More information about the Eric mailing list