eric6/QScintilla/DocstringGenerator/EricdocGenerator.py

changeset 8000
47b15df088e4
parent 7998
cd41c844862f
child 8005
94a6a1bd5f80
equal deleted inserted replaced
7999:159689297bc0 8000:47b15df088e4
19 the docstring on 19 the docstring on
20 @type FunctionInfo 20 @type FunctionInfo
21 @return list of docstring lines 21 @return list of docstring lines
22 @rtype str 22 @rtype str
23 """ 23 """
24 # __IGNORE_WARNING_D202__
24 lines = [] 25 lines = []
25 26
26 # create a basic/partial function description 27 # create a basic/partial function description
27 descrComplete = False
28 if functionInfo.functionType == "classmethod": 28 if functionInfo.functionType == "classmethod":
29 descr = "Class method " 29 descr = "Class method "
30 elif functionInfo.functionType == "staticmethod": 30 elif functionInfo.functionType == "staticmethod":
31 descr = "Static method " 31 descr = "Static method "
32 elif functionInfo.functionType == "constructor": 32 elif functionInfo.functionType == "constructor":
33 descr = "Constructor" 33 descr = "Constructor"
34 descrComplete = True
35 else: 34 else:
36 if functionInfo.visibility == "public": 35 if functionInfo.visibility == "public":
37 descr = "Public " 36 descr = "Public "
38 elif functionInfo.visibility == "protected": 37 elif functionInfo.visibility == "protected":
39 descr = "Protected " 38 descr = "Protected "
59 descr = "Coroutine " 58 descr = "Coroutine "
60 elif functionInfo.functionType == "qtslot": 59 elif functionInfo.functionType == "qtslot":
61 descr = "Slot " 60 descr = "Slot "
62 else: 61 else:
63 descr = "Function " 62 descr = "Function "
64 if not descrComplete:
65 descr += "DESCRIPTION"
66 lines.append(descr) 63 lines.append(descr)
67 64
68 # remove 'self', 'this' or 'cls' from arguments list 65 # remove 'self', 'this' or 'cls' from arguments list
69 if ( 66 if (
70 len(functionInfo.argumentsList) > 0 and 67 len(functionInfo.argumentsList) > 0 and

eric ide

mercurial