[Uml-devel] [Bug 75454] python code generation with purely virtual methods

Oliver Kellogg okellogg at users.sourceforge.net
Wed Jul 13 22:36:08 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=75454         
okellogg users sourceforge net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From okellogg users sourceforge net  2005-07-14 07:34 -------
SVN commit 434449 by okellogg:

m_bNeedPass: New flag controls emission of a final "pass" statement.
BUG:75454


 M  +9 -3      pythonwriter.cpp  
 M  +2 -0      pythonwriter.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/pythonwriter.cpp #434448:434449
 @ -34,8 +34,8  @
 #include "../operation.h"
 #include "../umlnamespace.h"
 
-PythonWriter::PythonWriter( UMLDoc *parent, const char *name ) :
-SimpleCodeGenerator( parent, name) {
+PythonWriter::PythonWriter( UMLDoc *parent, const char *name )
+  : SimpleCodeGenerator(parent, name), m_bNeedPass(true) {
 }
 
 PythonWriter::~PythonWriter() {}
 @ -53,6 +53,8  @
     UMLAssociationList aggregations = c->getAggregations();
     UMLAssociationList compositions = c->getCompositions();
 
+    m_bNeedPass = true;
+
     //find an appropriate name for our file
     fileName = findFileName(c,".py");
     if (!fileName) {
 @ -122,11 +124,15  @
         h<<m_indentation<<":version:"<<m_endl;
         h<<m_indentation<<":author:"<<m_endl;
         h<<m_indentation<<"\"\"\""<<m_endl<<m_endl;
+        m_bNeedPass = false;
     }
 
     //operations
     writeOperations(c,h);
 
+    if (m_bNeedPass)
+        h << m_indentation << "pass" << m_endl;
+
     //finish files
     h<<m_endl<<m_endl;
 
 @ -241,7 +247,7  @
             h<<m_indentation<<m_indentation<<"\"\"\""<<m_endl;
         }
         h<<m_indentation<<m_indentation<<"pass"<<m_endl<<m_endl;
-
+        m_bNeedPass = false;
     }//end for
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/pythonwriter.h #434448:434449
 @ -78,6 +78,8  @
       */
     void writeOperations(QString classname, UMLOperationList &opList,
                          QTextStream &h, Access access);
+
+    bool m_bNeedPass;  ///< True as long as no "pass" has been written
 };
 
 #endif //PYTHONWRITER




More information about the umbrello-devel mailing list