eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py

changeset 8228
772103b14c18
parent 8222
5994b80b8760
child 8229
6fa22aa4fc4a
equal deleted inserted replaced
8227:349308e84eeb 8228:772103b14c18
579 579
580 if equalPosition > -1: 580 if equalPosition > -1:
581 hasValue = True 581 hasValue = True
582 582
583 if colonPosition > -1: 583 if colonPosition > -1:
584 if not hasValue: 584 if not hasValue or equalPosition > colonPosition:
585 hasType = True
586 elif equalPosition > colonPosition:
587 # exception for def foo(arg1=":") 585 # exception for def foo(arg1=":")
588 hasType = True 586 hasType = True
589 587
590 if hasValue and hasType: 588 if hasValue and hasType:
591 argName = arg[0:colonPosition].strip() 589 argName = arg[0:colonPosition].strip()
680 decorator = textList.pop(0).strip() 678 decorator = textList.pop(0).strip()
681 if decorator == "@staticmethod": 679 if decorator == "@staticmethod":
682 self.functionType = "staticmethod" 680 self.functionType = "staticmethod"
683 elif decorator == "@classmethod": 681 elif decorator == "@classmethod":
684 self.functionType = "classmethod" 682 self.functionType = "classmethod"
685 elif re.match(r"@(PyQt[456]\.)?(QtCore\.)?pyqtSlot", decorator): 683 elif (
686 self.functionType = "qtslot" 684 re.match(r"@(PyQt[456]\.)?(QtCore\.)?pyqtSlot", decorator) or
687 elif re.match(r"@(PySide[26]\.)?(QtCore\.)?Slot", decorator): 685 re.match(r"@(PySide[26]\.)?(QtCore\.)?Slot", decorator)
686 ):
688 self.functionType = "qtslot" 687 self.functionType = "qtslot"
689 688
690 text = "".join(textList).strip() 689 text = "".join(textList).strip()
691 690
692 if text.startswith("async def "): 691 if text.startswith("async def "):

eric ide

mercurial