Bug report #5752

Customisation framework widget tree parser fails

Added by Tim Sutton over 12 years ago. Updated over 11 years ago.

Status:Closed
Priority:Normal
Assignee:Radim Blazek
Category:Customisation Framework
Affected QGIS version:master Regression?:No
Operating System:Linux (Ubuntu) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:15258

Description

I'm trying to generate the widget tree for the release but it fails with:

timlinux@ultrabook:~/dev/cpp/Quantum-GIS/python$ python widgets_tree.py 
Loading UI files /home/timlinux/dev/cpp/Quantum-GIS/src/ui/*.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerlabelwidgetbase.ui
Got bus address:  "unix:abstract=/tmp/dbus-LkwRif98Hb,guid=c9a8809c9934813ca938cebd00000033" 
Connected to accessibility bus at:  "unix:abstract=/tmp/dbus-LkwRif98Hb,guid=c9a8809c9934813ca938cebd00000033" 
Registered DEC:  true 
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmssqlnewconnectionbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposervectorlegendbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerlegendlayersdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsabout.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsembedlayerdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscredentialdialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsvectorgradientcolorrampv2dialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscompositionwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposermapwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssymbolv2propertiesdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdetaileditemwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgspgnewconnectionbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsgpsinformationwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssimplifytolerancedialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgslabeldialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgswfssourceselectbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgstipguibase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdisplayanglebase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsattributeselectiondialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerlegenditemdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposershapewidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsattributeactiondialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsattributetypeedit.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgisapp.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdecorationnortharrowdialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgstilescalewidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsformannotationdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssymbollevelsv2dialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsgraduatedsymboldialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmessageviewer.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsattributeloadfrommap.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsaddjoindialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsrasterlayerpropertiesbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgshandlebadlayersbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerpicturewidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgslabelpropertydialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsattributetabledialog.ui
'module' object has no attribute 'QgsAttributeTableView'
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdecorationcopyrightdialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdelattrdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdecorationscalebardialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerlegendwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsstylev2exportimportdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsvectorlayerpropertiesbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsbrowserlayerpropertiesbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposeritemwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsrastercalcdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsprojectpropertiesbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsspatialitesridsdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscustomprojectiondialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsidentifyresultsbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscontinuouscolordialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssinglesymboldialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgslabelingguibase.ui
'module' object has no attribute 'QgsLabelPreview'
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsnewhttpconnectionbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsaddattrdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmessagelogviewer.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsconfigureshortcutsdialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsrendererrulepropsdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsvectorrandomcolorrampv2dialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsexpressionbuilder.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgshelpviewerbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsgenericprojectionselectorbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposertablewidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssponsorsbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsstylev2managerdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsgraduatedsymbolrendererv2widget.ui
'module' object has no attribute 'QgsColorRampComboBox'
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsannotationwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsuniquevaluedialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsrendererv2propsdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsludialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsnewogrconnectionbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsfieldcalculatorbase.ui
No module named qgsexpressionbuilderwidget
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsitempositiondialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposermanagerbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsprojectionselectorbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerarrowwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsdbsourceselectbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgspastetransformationsbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgswmssourceselectbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmeasurebase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssymbolv2selectordialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgssnappingdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmergeattributesdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscomposerscalebarwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgstextannotationdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsquerybuilderbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsvectorcolorbrewercolorrampv2dialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscategorizedsymbolrendererv2widget.ui
'module' object has no attribute 'QgsColorRampComboBox'
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsoptionsbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgspluginmanagerbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsopenvectorlayerdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsexpressionbuilderdialogbase.ui
No module named qgsexpressionbuilderwidget
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscustomizationdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgscompositionbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgspointdisplacementrendererwidgetbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsogrsublayersdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsrulebasedrendererv2widget.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsengineconfigdialog.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsnewspatialitelayerdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsvectorlayersaveasdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsnewvectorlayerdialogbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsbookmarksbase.ui
Loading /home/timlinux/dev/cpp/Quantum-GIS/src/ui/qgsmanageconnectionsdialogbase.ui
Traceback (most recent call last):
  File "widgets_tree.py", line 124, in <module>
    xml = inspector.xml()
  File "widgets_tree.py", line 115, in xml
    string =  tostring ( element, 'utf-8' )
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1127, in tostring
    ElementTree(element).write(file, encoding, method=method)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 821, in write
    serialize(write, self._root, encoding, qnames, namespaces)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 940, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 933, in _serialize_xml
    v = _escape_attrib(v, encoding)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1093, in _escape_attrib
    _raise_serialization_error(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1053, in _raise_serialization_error
    "cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize PyQt4.QtCore.QString(u'QgsComposerLabelWidgetBase') (type QString)

widgets_tree.py.patch Magnifier (484 Bytes) Radim Blazek, 2012-06-07 12:07 AM

Associated revisions

Revision 99f998aa
Added by Jürgen Fischer over 11 years ago

- add missing sip bindings
- port widgets_tree.py to QtXml and update customization.xml (fixes #5752 and #8054)

History

#1 Updated by Tim Sutton over 12 years ago

  • Priority changed from Normal to Severe/Regression

#2 Updated by Radim Blazek over 12 years ago

  • Priority changed from Severe/Regression to Normal

I dont think it is a blocker. I updated already the resources/customization.xml after feature freeze in 5a4412a21d and since then just a single typo in a label have changed (which was also fixed in 78701d8fb40).

#3 Updated by Radim Blazek over 12 years ago

It fails in element conversion to string but the problem is probably in the element, which should be a string ('QgsComposerLabelWidgetBase') while it seems to be a reference (?) to PyQt4.QtCore.QString. It seems that it only happens with Python 2.7, I have only 2.6 on my machines. Could you please try the patch attached?

#4 Updated by Tim Sutton over 12 years ago

Hi

Ok good if the customization file is current then its not urgent to resolve thanks.

Regards

Tim

#5 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#6 Updated by Jürgen Fischer over 11 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF