Bug 272972

Summary: umbrello parses python classes incorrectly
Product: [Applications] umbrello Reporter: Alex <s9gf4ult>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: erik.rakhorst
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.12.5
Attachments: The original file
do not add colon during python import

Description Alex 2011-05-10 21:09:17 UTC
Created attachment 59882 [details]
The original file

Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

when parse python methods umbrello inserts unnecessarry semicolumn in the begining of methond. It also generates not correct python code (incorrect indents)

Reproducible: Always

Steps to Reproduce:
1.Try to parse this
#!/bin/env python
# -*- coging: utf-8 -*-

class hello_class:
    def say_hello(self, param):
        print("hello")
        if 1 == 1:
            a = ["!!!!!!!!!!!!!!11", 23,
                 100, 200]
        else:
            a = 2020
2. export this class again

Actual Results:  

class hello_class(object):

    """
     -*- coging: utf-8 -*-

    :version:
    :author:
    """

    def say_hello(self, self, param):
        """
         

        @param string self : 
        @param string param : 
        @return string :
        @author
        """
        :
        print("hello")
        if 1==1:
          a=["!!!!!!!!!!!!!!11",23,
          100,200]
        else:
          a=2020
Comment 1 Erik Rakhorst 2014-04-23 19:57:16 UTC
Created attachment 86234 [details]
do not add colon during python import

This patch does not add an initial colon for every method during import.
It does not fix the indentation.
Comment 2 Ralf Habacker 2014-04-23 21:05:22 UTC
Git commit 4a07fa7060827260d60d6674ad3ab2eb17a849ed by Ralf Habacker, on behalf of Erik Rakhorst.
Committed on 23/04/2014 at 21:04.
Pushed by habacker into branch 'master'.

Do not add an initial colon for every method during python import.

M  +1    -1    umbrello/codeimport/pythonimport.cpp

http://commits.kde.org/umbrello/4a07fa7060827260d60d6674ad3ab2eb17a849ed
Comment 3 Ralf Habacker 2014-04-23 21:06:35 UTC
Git commit 05212b94c969d309d7389f8c914bdd6d0cd9f2aa by Ralf Habacker, on behalf of Erik Rakhorst.
Committed on 23/04/2014 at 21:04.
Pushed by habacker into branch 'KDE/4.13'.

Do not add an initial colon for every method during python import.
FIXED-IN:4.13.1
(cherry picked from commit 4a07fa7060827260d60d6674ad3ab2eb17a849ed)

M  +1    -1    umbrello/codeimport/pythonimport.cpp

http://commits.kde.org/umbrello/05212b94c969d309d7389f8c914bdd6d0cd9f2aa
Comment 4 Ralf Habacker 2014-04-23 21:07:42 UTC
Git commit c58a64ca9b3ec983e97559a3cf21802400928ca6 by Ralf Habacker, on behalf of Erik Rakhorst.
Committed on 23/04/2014 at 21:04.
Pushed by habacker into branch 'KDE/4.12'.

Do not add an initial colon for every method during python import.
FIXED-IN:4.12.5
(cherry picked from commit 4a07fa7060827260d60d6674ad3ab2eb17a849ed)

M  +1    -1    umbrello/codeimport/pythonimport.cpp

http://commits.kde.org/umbrello/c58a64ca9b3ec983e97559a3cf21802400928ca6