RefactoringRope/CodeAssistClient.py

changeset 228
e76a4991faef
parent 217
874115c79ca7
child 232
65d7d745543d
equal deleted inserted replaced
226:43f655d0f49d 228:e76a4991faef
295 @type str 295 @type str
296 @return dictionary containing document information 296 @return dictionary containing document information
297 @rtype dictionary with keys "name", "argspec", "module" and 297 @rtype dictionary with keys "name", "argspec", "module" and
298 "docstring" 298 "docstring"
299 """ 299 """
300 objectFullname = '' 300 objectFullname = ""
301 calltip = '' 301 calltip = ""
302 argspec = '' 302 argspec = ""
303 module = '' 303 module = ""
304 304
305 if cts: 305 if cts:
306 cts = cts.replace('.__init__', '') 306 cts = cts.replace(".__init__", "")
307 parenthesisPos = cts.find('(') 307 parenthesisPos = cts.find("(")
308 if parenthesisPos: 308 if parenthesisPos != -1:
309 objectFullname = cts[:parenthesisPos] 309 objectFullname = cts[:parenthesisPos]
310 objectName = objectFullname.split('.')[-1] 310 objectName = objectFullname.split('.')[-1]
311 cts = cts.replace(objectFullname, objectName) 311 cts = cts.replace(objectFullname, objectName)
312 calltip = cts 312 calltip = cts
313 if objectFullname and not objectFullname.startswith('self.'): 313 else:
314 objectFullname = cts
315 if objectFullname and not objectFullname.startswith("self."):
314 if calltip: 316 if calltip:
315 argspecStart = calltip.find('(') 317 argspecStart = calltip.find("(")
316 argspec = calltip[argspecStart:] 318 argspec = calltip[argspecStart:]
317 moduleEnd = objectFullname.rfind('.') 319
318 module = objectFullname[:moduleEnd] 320 moduleEnd = objectFullname.rfind('.')
321 module = objectFullname[:moduleEnd]
319 322
320 if not documentation and not calltip: 323 if not documentation and not calltip:
321 return None 324 return None
322 325
323 return dict(name=objectFullname, argspec=argspec, module=module, 326 return dict(name=objectFullname, argspec=argspec, module=module,

eric ide

mercurial