RefactoringRope/CodeAssistClient.py

changeset 228
e76a4991faef
parent 217
874115c79ca7
child 232
65d7d745543d
--- a/RefactoringRope/CodeAssistClient.py	Thu Nov 02 15:50:46 2017 +0100
+++ b/RefactoringRope/CodeAssistClient.py	Sun Nov 05 13:19:52 2017 +0100
@@ -297,25 +297,28 @@
         @rtype dictionary with keys "name", "argspec", "module" and
             "docstring"
         """
-        objectFullname = ''
-        calltip = ''
-        argspec = ''
-        module = ''
+        objectFullname = ""
+        calltip = ""
+        argspec = ""
+        module = ""
 
         if cts:
-            cts = cts.replace('.__init__', '')
-            parenthesisPos = cts.find('(')
-            if parenthesisPos:
+            cts = cts.replace(".__init__", "")
+            parenthesisPos = cts.find("(")
+            if parenthesisPos != -1:
                 objectFullname = cts[:parenthesisPos]
                 objectName = objectFullname.split('.')[-1]
                 cts = cts.replace(objectFullname, objectName)
                 calltip = cts
-        if objectFullname and not objectFullname.startswith('self.'):
+            else:
+                objectFullname = cts
+        if objectFullname and not objectFullname.startswith("self."):
             if calltip:
-                argspecStart = calltip.find('(')
+                argspecStart = calltip.find("(")
                 argspec = calltip[argspecStart:]
-                moduleEnd = objectFullname.rfind('.')
-                module = objectFullname[:moduleEnd]
+            
+            moduleEnd = objectFullname.rfind('.')
+            module = objectFullname[:moduleEnd]
 
         if not documentation and not calltip:
             return None

eric ide

mercurial