Version: 1.4.2 (using KDE KDE 3.4.0) Installed from: Compiled From Sources Compiler: gcc (GCC) 3.3.5 OS: Linux If I generate Python code for classes assigned to packages, an invalid Python import statement like "from Package/Class_to_import import *" is written. This Python syntax error can be simply corrected by replacing "/" by ".". The corresponding patch for "umbrello-1.4.2/umbrello/umbrello/codegenerators/pythonwriter.cpp" is 102c102,107 < h<<"from "<<headerName<<" import *"<<m_endl; --- > if ( headerName.find('/') > 0) { > h<<"from "<<headerName.replace(QChar('/'),QChar('.'))<<" import *"<<m_endl; > } > else { > h<<"from "<<headerName<<" import *"<<m_endl; > }
SVN commit 462333 by okellogg: BUG:112936 - writeClass(): Apply patch from Egbert Voigt. M +1 -0 ChangeLog M +1 -0 THANKS M +4 -1 umbrello/codegenerators/pythonwriter.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #462332:462333 @@ -12,6 +12,7 @@ 57588 57672 58809 66461 67120 67719 72016 79433 87252 88117 97162 105564 108223 109591 109636 110073 110216 110231 110379 111088 111470 111502 111759 111768 112017 112292 112293 112333 112531 112552 +112936 Version 1.4.2 (maintenance release) --- branches/KDE/3.5/kdesdk/umbrello/THANKS #462332:462333 @@ -65,6 +65,7 @@ Tanuj <tagrawal @hss.hns.com> Brian Thomas <brian.thomas @gsfc.nasa.gov> Jean Vittor <jean.vittor @wanadoo.fr> +Egbert Voigt <Egbert.Voigt @alcatel.de> Stefan Walter <sw @gegenunendlich.de> Yurgen Wolfgang <raptorsforever @softhome.net> Maciej J. Woloszyk <mat @esi.com.pl> --- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/pythonwriter.cpp #462332:462333 @@ -101,7 +101,10 @@ first = headerName.at(0); first = first.upper(); headerName = headerName.replace(0, 1, first); - h<<"from "<<headerName<<" import *"<<m_endl; + if (headerName.find('/') > 0) + h<<"from "<<headerName.replace(QChar('/'),QChar('.'))<<" import *"<<m_endl; + else + h<<"from "<<headerName<<" import *"<<m_endl; } } h<<m_endl;