Bug 374597

Summary: Python export and re-import breaks function names and private attribute of private functions
Product: [Applications] umbrello Reporter: a.baumfalk
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.13.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 2.21.1 (KDE Applications 16.12.1)
Attachments: re-imported from python code
starting case after adding public/private function pair

Description a.baumfalk 2017-01-05 15:08:40 UTC
Created attachment 103213 [details]
re-imported from python code

Steps to reproduce:
---------------------------
1. create a class with a public function named "publicFunction" and a private function named "privateFunction".
2. Export to python, result will be:
---
class MyClass(object):

  """


  :version:
  :author:
  """

  def publicFunction(self):
    """


    @return  :
    @author
    """
    pass

  def __privateFunction(self):
    """


    @return  :
    @author
    """
    pass
---

3. re-import from exported Code (see attached Umbrello2.xmi).
As a result I get a public function with the name "__privateFunction" instead of a private function with the name "privateFunction".
Comment 1 a.baumfalk 2017-01-05 15:10:00 UTC
Created attachment 103214 [details]
starting case after adding public/private function pair
Comment 2 Ralf Habacker 2017-01-05 15:43:34 UTC
Git commit 4284cc069969b3b53916f7eeaaed5fa0c62ac54d by Ralf Habacker.
Committed on 05/01/2017 at 15:43.
Pushed by habacker into branch 'Applications/16.12'.

Parse and set method visibility in python import.
FIXED-IN:2.21.1 (KDE Applications 16.12.1)

M  +10   -3    umbrello/codeimport/pythonimport.cpp

https://commits.kde.org/umbrello/4284cc069969b3b53916f7eeaaed5fa0c62ac54d