QScintilla/Editor.py

changeset 777
f0f24d2f9eab
parent 741
137cc6344b48
child 788
5b1b59777460
equal deleted inserted replaced
776:0359a079eb0d 777:f0f24d2f9eab
144 """ 144 """
145 QsciScintillaCompat.__init__(self) 145 QsciScintillaCompat.__init__(self)
146 self.setAttribute(Qt.WA_DeleteOnClose) 146 self.setAttribute(Qt.WA_DeleteOnClose)
147 self.setAttribute(Qt.WA_KeyCompression) 147 self.setAttribute(Qt.WA_KeyCompression)
148 self.setUtf8(True) 148 self.setUtf8(True)
149
150 self.pyExtensions = dbs.getExtensions('Python')
151 self.py3Extensions = dbs.getExtensions('Python3')
152 self.rbExtensions = dbs.getExtensions('Ruby')
153 149
154 self.dbs = dbs 150 self.dbs = dbs
155 self.taskViewer = tv 151 self.taskViewer = tv
156 self.fileName = fn 152 self.fileName = fn
157 self.vm = vm 153 self.vm = vm
1553 1549
1554 @return flag indicating a Python file (boolean) 1550 @return flag indicating a Python file (boolean)
1555 """ 1551 """
1556 return self.filetype == "Python" or \ 1552 return self.filetype == "Python" or \
1557 (self.fileName is not None and \ 1553 (self.fileName is not None and \
1558 os.path.splitext(self.fileName)[1] in self.pyExtensions) 1554 os.path.splitext(self.fileName)[1] in self.dbs.getExtensions('Python'))
1559 1555
1560 def isPy3File(self): 1556 def isPy3File(self):
1561 """ 1557 """
1562 Public method to return a flag indicating a Python3 file. 1558 Public method to return a flag indicating a Python3 file.
1563 1559
1564 @return flag indicating a Python3 file (boolean) 1560 @return flag indicating a Python3 file (boolean)
1565 """ 1561 """
1566 return self.filetype == "Python3" or \ 1562 return self.filetype == "Python3" or \
1567 (self.fileName is not None and \ 1563 (self.fileName is not None and \
1568 os.path.splitext(self.fileName)[1] in self.py3Extensions) 1564 os.path.splitext(self.fileName)[1] in self.dbs.getExtensions('Python3'))
1569 1565
1570 def isRubyFile(self): 1566 def isRubyFile(self):
1571 """ 1567 """
1572 Public method to return a flag indicating a Ruby file. 1568 Public method to return a flag indicating a Ruby file.
1573 1569
1574 @return flag indicating a Ruby file (boolean) 1570 @return flag indicating a Ruby file (boolean)
1575 """ 1571 """
1576 return self.filetype == "Ruby" or \ 1572 return self.filetype == "Ruby" or \
1577 (self.fileName is not None and \ 1573 (self.fileName is not None and \
1578 os.path.splitext(self.fileName)[1] in self.rbExtensions) 1574 os.path.splitext(self.fileName)[1] in self.dbs.getExtensions('Ruby'))
1579 1575
1580 def highlightVisible(self): 1576 def highlightVisible(self):
1581 """ 1577 """
1582 Public method to make sure that the highlight is visible. 1578 Public method to make sure that the highlight is visible.
1583 """ 1579 """

eric ide

mercurial