While importing python code, umbrello imports also the 'self' parameter of each operation. On generation however, it creates one automatically. So if I import python code, then generate it, I suddenly have two 'self' parameters. I see two solutions: - do not import the 'self' parameter - have an option to generate the 'self' parameter automatically Reproducible: Always Steps to Reproduce: 1. import python code including some operations (with the 'self' paramter) 2. generate code from the imported design 3. check generated files to see double 'self' parameter in operations Actual Results: 'self' parameter is present two times in generated code Expected Results: Either way do not import 'self' parameter or do not generate it automatically every time
Created attachment 86235 [details] ignore all 'self' parameters during import This will fix the dual self parameters after an import and export of python code.
Git commit b68bd35c944d3abee7a5f5d1c982f1cd144e765a by Oliver Kellogg. Committed on 29/05/2014 at 12:22. Pushed by okellogg into branch 'master'. Apply modified version of https://bugs.kde.org/attachment.cgi?id=86235 umbrello/codeimport/pythonimport.h - Add member m_isStatic of type bool defaulting to false. umbrello/codeimport/pythonimport.cpp function parseStmt() - Decode "@staticmethod" to set m_isStatic true. - In handling of keyword "def", - If first parameter is not named "self" then set m_isStatic true and add the parameter via Import_Utils::addMethodParameter(); else do not add the parameter. - At call to Import_Utils::insertMethod(), provide m_isStatic as argument `isStatic'. - Reset m_isStatic false after call to Import_Utils::insertMethod(). M +20 -2 umbrello/codeimport/pythonimport.cpp M +1 -0 umbrello/codeimport/pythonimport.h http://commits.kde.org/umbrello/b68bd35c944d3abee7a5f5d1c982f1cd144e765a
Git commit de77ff0c13706fd2784e11a721be96dd97747f98 by Oliver Kellogg. Committed on 29/05/2014 at 12:22. Pushed by okellogg into branch 'KDE/4.13'. Apply modified version of https://bugs.kde.org/attachment.cgi?id=86235 umbrello/codeimport/pythonimport.h - Add member m_isStatic of type bool defaulting to false. umbrello/codeimport/pythonimport.cpp function parseStmt() - Decode "@staticmethod" to set m_isStatic true. - In handling of keyword "def", - If first parameter is not named "self" then set m_isStatic true and add the parameter via Import_Utils::addMethodParameter(); else do not add the parameter. - At call to Import_Utils::insertMethod(), provide m_isStatic as argument `isStatic'. - Reset m_isStatic false after call to Import_Utils::insertMethod(). M +20 -2 umbrello/codeimport/pythonimport.cpp M +1 -0 umbrello/codeimport/pythonimport.h http://commits.kde.org/umbrello/de77ff0c13706fd2784e11a721be96dd97747f98