[Uml-devel] [Bug 112936] New: python code generation with UML packages defective
Egbert Voigt
Egbert.Voigt at alcatel.de
Tue Sep 20 03:17:25 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=112936
Summary: python code generation with UML packages defective
Product: umbrello
Version: 1.4.2
Platform: Compiled Sources
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
AssignedTo: umbrello-devel.kde.org
ReportedBy: Egbert.Voigt alcatel de
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;
> }
More information about the umbrello-devel
mailing list