Skip to content

Commit 9db9ef8

Browse files
committedSep 11, 2012
Add support for prepared API file
- Prepared API file supports Python 2.7, PyQGIS master, PyQt4.7.4, QScintilla2 2.4.5, osgeo 1.9.1 - Set point size larger (should be setting in app) - Remove extra spacing between toolbar and console edit widget - Remove space from Qt object name - With many more API lines, autocompletion should start at least on second character, if not third
1 parent 02b6873 commit 9db9ef8

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed
 

‎python/api/pyqgis_master.pap

919 KB
Binary file not shown.

‎python/console.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def flush(self):
6969
class PythonConsole(QDockWidget):
7070
def __init__(self, parent=None):
7171
QDockWidget.__init__(self, parent)
72-
self.setObjectName("Python Console")
72+
self.setObjectName("PythonConsole")
7373
#self.setAllowedAreas(Qt.BottomDockWidgetArea)
7474

7575
self.widgetButton = QWidget()
@@ -93,6 +93,7 @@ def __init__(self, parent=None):
9393
self.e = QHBoxLayout(self.widgetEdit)
9494

9595
self.e.setMargin(0)
96+
self.e.setSpacing(0)
9697
self.b.setMargin(0)
9798

9899
## Action for Clear button

‎python/console_sci.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def __init__(self, parent=None):
8787
#self.setTabIndents(True)
8888
#self.setBackspaceUnindents(True)
8989
#self.setTabWidth(4)
90-
91-
self.setAutoCompletionThreshold(1)
90+
91+
self.setAutoCompletionThreshold(2)
9292
self.setAutoCompletionSource(self.AcsAPIs)
9393

9494
# Don't want to see the horizontal scrollbar at all
@@ -147,7 +147,7 @@ def setLexers(self, lexer):
147147
font = QFont()
148148
font.setFamily('Courier New') ## Courier New
149149
font.setFixedPitch(True)
150-
font.setPointSize(10)
150+
font.setPointSize(13)
151151
self.setFont(font)
152152
self.setMarginsFont(font)
153153
self.lexer = QsciLexerPython()
@@ -161,15 +161,16 @@ def setLexers(self, lexer):
161161
self.lexer.setFont(font, 3)
162162
self.lexer.setFont(font, 4)
163163
self.api = QsciAPIs(self.lexer)
164-
self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
165-
self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
164+
self.api.loadPrepared(QString(os.path.dirname(__file__) + "/api/pyqgis_master.pap"))
165+
# self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
166+
# self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
166167
# self.api.load("qgis.networkanalysis.api")
167168
# self.api.load("qgis.gui.api")
168169
# self.api.load("qgis.core.api")
169170
# self.api.load("qgis.analysis.api")
170-
171-
self.api.prepare()
172-
self.lexer.setAPIs(self.api)
171+
172+
# self.api.prepare()
173+
# self.lexer.setAPIs(self.api)
173174
self.setLexer(self.lexer)
174175

175176
## TODO: show completion list for file and directory

0 commit comments

Comments
 (0)
Please sign in to comment.