Skip to content

Commit

Permalink
Merge pull request #1 from dakcarto/slarosa_pyqgisconsole
Browse files Browse the repository at this point in the history
Add support for prepared API file
  • Loading branch information
slarosa committed Sep 11, 2012
2 parents 02b6873 + 9db9ef8 commit 07735b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Binary file added python/api/pyqgis_master.pap
Binary file not shown.
3 changes: 2 additions & 1 deletion python/console.py
Expand Up @@ -69,7 +69,7 @@ def flush(self):
class PythonConsole(QDockWidget):
def __init__(self, parent=None):
QDockWidget.__init__(self, parent)
self.setObjectName("Python Console")
self.setObjectName("PythonConsole")
#self.setAllowedAreas(Qt.BottomDockWidgetArea)

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

self.e.setMargin(0)
self.e.setSpacing(0)
self.b.setMargin(0)

## Action for Clear button
Expand Down
17 changes: 9 additions & 8 deletions python/console_sci.py
Expand Up @@ -87,8 +87,8 @@ def __init__(self, parent=None):
#self.setTabIndents(True)
#self.setBackspaceUnindents(True)
#self.setTabWidth(4)
self.setAutoCompletionThreshold(1)

self.setAutoCompletionThreshold(2)
self.setAutoCompletionSource(self.AcsAPIs)

# Don't want to see the horizontal scrollbar at all
Expand Down Expand Up @@ -147,7 +147,7 @@ def setLexers(self, lexer):
font = QFont()
font.setFamily('Courier New') ## Courier New
font.setFixedPitch(True)
font.setPointSize(10)
font.setPointSize(13)
self.setFont(font)
self.setMarginsFont(font)
self.lexer = QsciLexerPython()
Expand All @@ -161,15 +161,16 @@ def setLexers(self, lexer):
self.lexer.setFont(font, 3)
self.lexer.setFont(font, 4)
self.api = QsciAPIs(self.lexer)
self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
self.api.loadPrepared(QString(os.path.dirname(__file__) + "/api/pyqgis_master.pap"))
# self.api.load(os.path.dirname(__file__) + "/api/PyQGIS_1.8.api")
# self.api.load(os.path.dirname(__file__) + "/api/osgeo_gdal-ogr_1.9.1-1.api")
# self.api.load("qgis.networkanalysis.api")
# self.api.load("qgis.gui.api")
# self.api.load("qgis.core.api")
# self.api.load("qgis.analysis.api")
self.api.prepare()
self.lexer.setAPIs(self.api)

# self.api.prepare()
# self.lexer.setAPIs(self.api)
self.setLexer(self.lexer)

## TODO: show completion list for file and directory
Expand Down

0 comments on commit 07735b7

Please sign in to comment.