Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 1, 2013
1 parent 334f43e commit d0aa1e4
Show file tree
Hide file tree
Showing 60 changed files with 450 additions and 450 deletions.
14 changes: 7 additions & 7 deletions python/console/console.py
Expand Up @@ -109,22 +109,22 @@ def __init__(self, parent=None):
self.splitter.addWidget(self.shellOut) self.splitter.addWidget(self.shellOut)
self.splitter.addWidget(self.shell) self.splitter.addWidget(self.shell)
#self.splitterEditor.addWidget(self.tabEditorWidget) #self.splitterEditor.addWidget(self.tabEditorWidget)

self.splitterObj = QSplitter(self.splitterEditor) self.splitterObj = QSplitter(self.splitterEditor)
self.splitterObj.setHandleWidth(3) self.splitterObj.setHandleWidth(3)
self.splitterObj.setOrientation(Qt.Horizontal) self.splitterObj.setOrientation(Qt.Horizontal)
#self.splitterObj.setSizes([0, 0]) #self.splitterObj.setSizes([0, 0])
#self.splitterObj.setStretchFactor(0, 1) #self.splitterObj.setStretchFactor(0, 1)

self.widgetEditor = QWidget(self.splitterObj) self.widgetEditor = QWidget(self.splitterObj)

self.listClassMethod = QTreeWidget(self.splitterObj) self.listClassMethod = QTreeWidget(self.splitterObj)
self.listClassMethod.setColumnCount(2) self.listClassMethod.setColumnCount(2)
self.listClassMethod.setHeaderLabels(['Object', 'Line']) self.listClassMethod.setHeaderLabels(['Object', 'Line'])
self.listClassMethod.setColumnHidden(1, True) self.listClassMethod.setColumnHidden(1, True)
self.listClassMethod.setAlternatingRowColors(True) self.listClassMethod.setAlternatingRowColors(True)



#self.splitterEditor.addWidget(self.widgetEditor) #self.splitterEditor.addWidget(self.widgetEditor)
#self.splitterObj.addWidget(self.listClassMethod) #self.splitterObj.addWidget(self.listClassMethod)
#self.splitterObj.addWidget(self.widgetEditor) #self.splitterObj.addWidget(self.widgetEditor)
Expand Down Expand Up @@ -528,7 +528,7 @@ def uncommentCode(self):
# if line != "\n": # if line != "\n":
# listScriptFile.append(line) # listScriptFile.append(line)
# self.shell.insertTextFromFile(listScriptFile) # self.shell.insertTextFromFile(listScriptFile)
# #
# lastDirPath = QFileInfo(scriptFile).path() # lastDirPath = QFileInfo(scriptFile).path()
# settings.setValue("pythonConsole/lastDirPath", QVariant(scriptFile)) # settings.setValue("pythonConsole/lastDirPath", QVariant(scriptFile))
# #
Expand All @@ -538,7 +538,7 @@ def uncommentCode(self):
# scriptFile.setDefaultSuffix(".py") # scriptFile.setDefaultSuffix(".py")
# fName = scriptFile.getSaveFileName( # fName = scriptFile.getSaveFileName(
# self, "Save file", QString(), "Script file (*.py)") # self, "Save file", QString(), "Script file (*.py)")
# #
# if fName.isEmpty() == False: # if fName.isEmpty() == False:
# filename = str(fName) # filename = str(fName)
# if not filename.endswith(".py"): # if not filename.endswith(".py"):
Expand Down Expand Up @@ -616,7 +616,7 @@ def callWidgetMessageBar(self, text):
def callWidgetMessageBarEditor(self, text, level, timed): def callWidgetMessageBarEditor(self, text, level, timed):
self.tabEditorWidget.widgetMessageBar(iface, text, level, timed) self.tabEditorWidget.widgetMessageBar(iface, text, level, timed)


def updateTabListScript(self, script, action=None): def updateTabListScript(self, script, action=None):
if script != '': if script != '':
settings = QSettings() settings = QSettings()
if script == 'empty': if script == 'empty':
Expand Down
51 changes: 26 additions & 25 deletions python/console/console_editor.py
Expand Up @@ -64,12 +64,12 @@ def get_handler(self, key, modifier):
if modifiers == modifier: if modifiers == modifier:
return handler return handler
return None return None

def eventFilter(self, obj, event): def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress and event.key() < 256: if event.type() == QEvent.KeyPress and event.key() < 256:
handler = self.get_handler(event.key(), event.modifiers()) handler = self.get_handler(event.key(), event.modifiers())
if handler: if handler:
handler(self.window, self.tab) handler(self.window, self.tab)
return QObject.eventFilter(self, obj, event) return QObject.eventFilter(self, obj, event)


class Editor(QsciScintilla): class Editor(QsciScintilla):
Expand Down Expand Up @@ -127,12 +127,12 @@ def __init__(self, parent=None):
#self.setWrapMode(QsciScintilla.WrapCharacter) #self.setWrapMode(QsciScintilla.WrapCharacter)
self.setWhitespaceVisibility(QsciScintilla.WsVisibleAfterIndent) self.setWhitespaceVisibility(QsciScintilla.WsVisibleAfterIndent)
#self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0) #self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)

self.settingsEditor() self.settingsEditor()

# Annotations # Annotations
#self.setAnnotationDisplay(QsciScintilla.ANNOTATION_BOXED) #self.setAnnotationDisplay(QsciScintilla.ANNOTATION_BOXED)

# Indentation # Indentation
self.setAutoIndent(True) self.setAutoIndent(True)
self.setIndentationsUseTabs(False) self.setIndentationsUseTabs(False)
Expand Down Expand Up @@ -161,7 +161,7 @@ def __init__(self, parent=None):
self.runScriptScut = QShortcut(QKeySequence(Qt.SHIFT + Qt.CTRL + Qt.Key_E), self) self.runScriptScut = QShortcut(QKeySequence(Qt.SHIFT + Qt.CTRL + Qt.Key_E), self)
self.runScriptScut.setContext(Qt.WidgetShortcut) self.runScriptScut.setContext(Qt.WidgetShortcut)
self.runScriptScut.activated.connect(self.runScriptCode) self.runScriptScut.activated.connect(self.runScriptCode)

self.commentScut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_3), self) self.commentScut = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_3), self)
self.commentScut.setContext(Qt.WidgetShortcut) self.commentScut.setContext(Qt.WidgetShortcut)
self.commentScut.activated.connect(self.parent.pc.commentCode) self.commentScut.activated.connect(self.parent.pc.commentCode)
Expand Down Expand Up @@ -295,8 +295,8 @@ def contextMenuEvent(self, e):
menu.addSeparator() menu.addSeparator()
commentCodeAction = menu.addAction(iconCommentEditor, "Comment", commentCodeAction = menu.addAction(iconCommentEditor, "Comment",
self.parent.pc.commentCode, 'Ctrl+3') self.parent.pc.commentCode, 'Ctrl+3')
uncommentCodeAction = menu.addAction(iconUncommentEditor, "Uncomment", uncommentCodeAction = menu.addAction(iconUncommentEditor, "Uncomment",
self.parent.pc.uncommentCode, self.parent.pc.uncommentCode,
'Shift+Ctrl+3') 'Shift+Ctrl+3')
menu.addSeparator() menu.addSeparator()
codePadAction = menu.addAction(iconCodePad, codePadAction = menu.addAction(iconCodePad,
Expand Down Expand Up @@ -391,7 +391,7 @@ def commentEditorCode(self, commentCheck):
else: else:
if not self.text(line).trimmed().startsWith('#'): if not self.text(line).trimmed().startsWith('#'):
continue continue
self.setSelection(line, self.indentation(line), self.setSelection(line, self.indentation(line),
line, self.indentation(line) + 1) line, self.indentation(line) + 1)
self.removeSelectedText() self.removeSelectedText()
else: else:
Expand All @@ -401,11 +401,11 @@ def commentEditorCode(self, commentCheck):
else: else:
if not self.text(line).trimmed().startsWith('#'): if not self.text(line).trimmed().startsWith('#'):
return return
self.setSelection(line, self.indentation(line), self.setSelection(line, self.indentation(line),
line, self.indentation(line) + 1) line, self.indentation(line) + 1)
self.removeSelectedText() self.removeSelectedText()
self.endUndoAction() self.endUndoAction()

def createTempFile(self): def createTempFile(self):
import tempfile import tempfile
fd, path = tempfile.mkstemp() fd, path = tempfile.mkstemp()
Expand All @@ -423,10 +423,10 @@ def _runSubProcess(self, filename, tmp=False):
try: try:
## set creationflags for runnning command without shell window ## set creationflags for runnning command without shell window
if sys.platform.startswith('win'): if sys.platform.startswith('win'):
p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE, p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE,
stderr=subprocess.PIPE, stdout=subprocess.PIPE, creationflags=0x08000000) stderr=subprocess.PIPE, stdout=subprocess.PIPE, creationflags=0x08000000)
else: else:
p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE, p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE,
stderr=subprocess.PIPE, stdout=subprocess.PIPE) stderr=subprocess.PIPE, stdout=subprocess.PIPE)
out, _traceback = p.communicate() out, _traceback = p.communicate()


Expand Down Expand Up @@ -465,13 +465,14 @@ def _runSubProcess(self, filename, tmp=False):


def runScriptCode(self): def runScriptCode(self):
autoSave = self.settings.value("pythonConsole/autoSaveScript").toBool() autoSave = self.settings.value("pythonConsole/autoSaveScript").toBool()

tabWidget = self.parent.tw.currentWidget() tabWidget = self.parent.tw.currentWidget()

filename = tabWidget.path filename = tabWidget.path

msgEditorBlank = QCoreApplication.translate('PythonConsole', msgEditorBlank = QCoreApplication.translate('PythonConsole',
'Hey, type something for running !') 'Hey, type something for running !')
msgEditorUnsaved = QCoreApplication.translate('PythonConsole', msgEditorUnsaved = QCoreApplication.translate('PythonConsole',
'You have to save the file before running.') 'You have to save the file before running.')
if not autoSave: if not autoSave:
if filename is None: if filename is None:
Expand Down Expand Up @@ -500,7 +501,7 @@ def getTextFromEditor(self):
text = self.text() text = self.text()
textList = text.split("\n") textList = text.split("\n")
return textList return textList

def goToLine(self, objName, linenr): def goToLine(self, objName, linenr):
self.SendScintilla(QsciScintilla.SCI_GOTOLINE, linenr-1) self.SendScintilla(QsciScintilla.SCI_GOTOLINE, linenr-1)
self.SendScintilla(QsciScintilla.SCI_SETTARGETSTART, self.SendScintilla(QsciScintilla.SCI_GETCURRENTPOS)) self.SendScintilla(QsciScintilla.SCI_SETTARGETSTART, self.SendScintilla(QsciScintilla.SCI_GETCURRENTPOS))
Expand Down Expand Up @@ -552,7 +553,7 @@ def __init__(self, parent, parentConsole, filename, *args):
self.newEditor = Editor(self) self.newEditor = Editor(self)
if filename: if filename:
self.path = filename self.path = filename
if os.path.exists(filename): if os.path.exists(filename)
self.loadFile(filename, False) self.loadFile(filename, False)


# Creates layout for message bar # Creates layout for message bar
Expand Down Expand Up @@ -589,15 +590,15 @@ def loadFile(self, filename, modified):


def save(self): def save(self):
if self.path is None: if self.path is None:
self.path = str(QFileDialog().getSaveFileName(self, self.path = str(QFileDialog().getSaveFileName(self,
"Python Console: Save file", "Python Console: Save file",
"*.py", "*.py",
"Script file (*.py)")) "Script file (*.py)"))
# If the user didn't select a file, abort the save operation # If the user didn't select a file, abort the save operation
if len(self.path) == 0: if len(self.path) == 0:
self.path = None self.path = None
return return
msgText = QCoreApplication.translate('PythonConsole', msgText = QCoreApplication.translate('PythonConsole',
'Script was correctly saved.') 'Script was correctly saved.')
self.pc.callWidgetMessageBarEditor(msgText, 0, True) self.pc.callWidgetMessageBarEditor(msgText, 0, True)
# Rename the original file, if it exists # Rename the original file, if it exists
Expand Down Expand Up @@ -706,9 +707,9 @@ def __init__(self, parent):


# Menu button list tabs # Menu button list tabs
self.fileTabMenu = QMenu(self) self.fileTabMenu = QMenu(self)
self.connect(self.fileTabMenu, SIGNAL("aboutToShow()"), self.connect(self.fileTabMenu, SIGNAL("aboutToShow()"),
self.showFileTabMenu) self.showFileTabMenu)
self.connect(self.fileTabMenu, SIGNAL("triggered(QAction*)"), self.connect(self.fileTabMenu, SIGNAL("triggered(QAction*)"),
self.showFileTabMenuTriggered) self.showFileTabMenuTriggered)
self.fileTabButton = QToolButton(self) self.fileTabButton = QToolButton(self)
self.fileTabButton.setToolTip('List all tabs') self.fileTabButton.setToolTip('List all tabs')
Expand Down Expand Up @@ -782,7 +783,7 @@ def _removeTab(self, tab, tab2index=False):
tab = self.indexOf(tab) tab = self.indexOf(tab)
if self.widget(tab).newEditor.isModified(): if self.widget(tab).newEditor.isModified():
res = QMessageBox.question( self, 'Python Console: Save File', res = QMessageBox.question( self, 'Python Console: Save File',
'The file <b>"%s"</b> has been modified, save changes ?' 'The file <b>"%s"</b> has been modified, save changes ?'
% self.tabText(tab), % self.tabText(tab),
QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel ) QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel )
if res == QMessageBox.Save: if res == QMessageBox.Save:
Expand Down Expand Up @@ -920,7 +921,7 @@ def listObject(self, tab):
s = traceback.format_exc() s = traceback.format_exc()
print '## Error: ' print '## Error: '
sys.stderr.write(s) sys.stderr.write(s)

def refreshSettingsEditor(self): def refreshSettingsEditor(self):
countTab = self.count() countTab = self.count()
for i in range(countTab): for i in range(countTab):
Expand Down
4 changes: 2 additions & 2 deletions python/console/console_output.py
Expand Up @@ -128,7 +128,7 @@ def __init__(self, parent=None):
self.selectAllShortcut.activated.connect(self.selectAll) self.selectAllShortcut.activated.connect(self.selectAll)


def insertInitText(self): def insertInitText(self):
txtInit = QCoreApplication.translate("PythonConsole", txtInit = QCoreApplication.translate("PythonConsole",
"Python %1 on %2\n" "Python %1 on %2\n"
"## Type help(iface) for more info and list of methods.\n").arg(sys.version, socket.gethostname()) "## Type help(iface) for more info and list of methods.\n").arg(sys.version, socket.gethostname())
initText = self.setText(txtInit) initText = self.setText(txtInit)
Expand Down Expand Up @@ -215,7 +215,7 @@ def hideToolBar(self):


def showEditor(self): def showEditor(self):
Ed = self.parent.splitterObj Ed = self.parent.splitterObj
if not Ed.isVisible(): if not Ed.isVisible():
Ed.show() Ed.show()
self.parent.showEditorButton.setChecked(True) self.parent.showEditorButton.setChecked(True)
self.shell.setFocus() self.shell.setFocus()
Expand Down
4 changes: 2 additions & 2 deletions python/console/console_sci.py
Expand Up @@ -160,7 +160,7 @@ def commandConsole(self, command):


def setLexers(self): def setLexers(self):
self.lexer = QsciLexerPython() self.lexer = QsciLexerPython()

loadFont = self.settings.value("pythonConsole/fontfamilytext", "Monospace").toString() loadFont = self.settings.value("pythonConsole/fontfamilytext", "Monospace").toString()
fontSize = self.settings.value("pythonConsole/fontsize", 10).toInt()[0] fontSize = self.settings.value("pythonConsole/fontsize", 10).toInt()[0]


Expand Down Expand Up @@ -514,7 +514,7 @@ def runCommand(self, cmd):
more = self.runsource(src, "<input>") more = self.runsource(src, "<input>")
if not more: if not more:
self.buffer = [] self.buffer = []
## prevents to commands with more lines to break the console ## prevents to commands with more lines to break the console
## in the case they have a eol different from '\n' ## in the case they have a eol different from '\n'
self.setText('') self.setText('')
self.move_cursor_to_end() self.move_cursor_to_end()
Expand Down
22 changes: 11 additions & 11 deletions python/console/console_settings.py
Expand Up @@ -64,7 +64,7 @@ def enableDisable(self, value):
self.tableWidget.setEnabled(value) self.tableWidget.setEnabled(value)
self.addAPIpath.setEnabled(value) self.addAPIpath.setEnabled(value)
self.removeAPIpath.setEnabled(value) self.removeAPIpath.setEnabled(value)

def autoCompletionOptions(self): def autoCompletionOptions(self):
if self.autoCompleteEnabled.isChecked(): if self.autoCompleteEnabled.isChecked():
self.enableDisableAutoCompleteOptions(True) self.enableDisableAutoCompleteOptions(True)
Expand Down Expand Up @@ -144,32 +144,32 @@ def saveSettings(self):
settings.setValue("pythonConsole/fontfamilyindex", QVariant(fontFamilyIndex)) settings.setValue("pythonConsole/fontfamilyindex", QVariant(fontFamilyIndex))
fontFamilyText = self.fontComboBox.currentText() fontFamilyText = self.fontComboBox.currentText()
settings.setValue("pythonConsole/fontfamilytext", QVariant(fontFamilyText)) settings.setValue("pythonConsole/fontfamilytext", QVariant(fontFamilyText))

fontFamilyIndexEditor = self.fontComboBoxEditor.currentIndex() fontFamilyIndexEditor = self.fontComboBoxEditor.currentIndex()
settings.setValue("pythonConsole/fontfamilyindexEditor", QVariant(fontFamilyIndexEditor)) settings.setValue("pythonConsole/fontfamilyindexEditor", QVariant(fontFamilyIndexEditor))
fontFamilyTextEditor = self.fontComboBoxEditor.currentText() fontFamilyTextEditor = self.fontComboBoxEditor.currentText()
settings.setValue("pythonConsole/fontfamilytextEditor", QVariant(fontFamilyTextEditor)) settings.setValue("pythonConsole/fontfamilytextEditor", QVariant(fontFamilyTextEditor))

fontSize = self.spinBox.value() fontSize = self.spinBox.value()
fontSizeEditor = self.spinBoxEditor.value() fontSizeEditor = self.spinBoxEditor.value()

for i in range(0, self.tableWidget.rowCount()): for i in range(0, self.tableWidget.rowCount()):
text = self.tableWidget.item(i, 1).text() text = self.tableWidget.item(i, 1).text()
self.listPath.append(text) self.listPath.append(text)
settings.setValue("pythonConsole/fontsize", QVariant(fontSize)) settings.setValue("pythonConsole/fontsize", QVariant(fontSize))
settings.setValue("pythonConsole/fontsizeEditor", QVariant(fontSizeEditor)) settings.setValue("pythonConsole/fontsizeEditor", QVariant(fontSizeEditor))
settings.setValue("pythonConsole/userAPI", QVariant(self.listPath)) settings.setValue("pythonConsole/userAPI", QVariant(self.listPath))

settings.setValue("pythonConsole/autoCompThreshold", QVariant(self.autoCompThreshold.value())) settings.setValue("pythonConsole/autoCompThreshold", QVariant(self.autoCompThreshold.value()))
settings.setValue("pythonConsole/autoCompThresholdEditor", QVariant(self.autoCompThresholdEditor.value())) settings.setValue("pythonConsole/autoCompThresholdEditor", QVariant(self.autoCompThresholdEditor.value()))

if self.autoCompFromAPIEditor.isChecked(): if self.autoCompFromAPIEditor.isChecked():
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromAPI')) settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromAPI'))
elif self.autoCompFromDocEditor.isChecked(): elif self.autoCompFromDocEditor.isChecked():
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDoc')) settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDoc'))
elif self.autoCompFromDocAPIEditor.isChecked(): elif self.autoCompFromDocAPIEditor.isChecked():
settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDocAPI')) settings.setValue("pythonConsole/autoCompleteSourceEditor", QVariant('fromDocAPI'))

if self.autoCompFromAPI.isChecked(): if self.autoCompFromAPI.isChecked():
settings.setValue("pythonConsole/autoCompleteSource", QVariant('fromAPI')) settings.setValue("pythonConsole/autoCompleteSource", QVariant('fromAPI'))
elif self.autoCompFromDoc.isChecked(): elif self.autoCompFromDoc.isChecked():
Expand Down Expand Up @@ -198,20 +198,20 @@ def restoreSettings(self):
self.tableWidget.horizontalHeader().show() self.tableWidget.horizontalHeader().show()
self.tableWidget.horizontalHeader().setResizeMode(1, QHeaderView.Stretch) self.tableWidget.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
self.autoSaveScript.setChecked(settings.value("pythonConsole/autoSaveScript", False).toBool()) self.autoSaveScript.setChecked(settings.value("pythonConsole/autoSaveScript", False).toBool())

self.autoCompThreshold.setValue(settings.value("pythonConsole/autoCompThreshold", 2).toInt()[0]) self.autoCompThreshold.setValue(settings.value("pythonConsole/autoCompThreshold", 2).toInt()[0])
self.autoCompThresholdEditor.setValue(settings.value("pythonConsole/autoCompThresholdEditor", 2).toInt()[0]) self.autoCompThresholdEditor.setValue(settings.value("pythonConsole/autoCompThresholdEditor", 2).toInt()[0])

self.autoCompleteEnabledEditor.setChecked(settings.value("pythonConsole/autoCompleteEnabledEditor", True).toBool()) self.autoCompleteEnabledEditor.setChecked(settings.value("pythonConsole/autoCompleteEnabledEditor", True).toBool())
self.autoCompleteEnabled.setChecked(settings.value("pythonConsole/autoCompleteEnabled", True).toBool()) self.autoCompleteEnabled.setChecked(settings.value("pythonConsole/autoCompleteEnabled", True).toBool())

if settings.value("pythonConsole/autoCompleteSource") == 'fromDoc': if settings.value("pythonConsole/autoCompleteSource") == 'fromDoc':
self.autoCompFromDoc.setChecked(True) self.autoCompFromDoc.setChecked(True)
elif settings.value("pythonConsole/autoCompleteSource") == 'fromAPI': elif settings.value("pythonConsole/autoCompleteSource") == 'fromAPI':
self.autoCompFromAPI.setChecked(True) self.autoCompFromAPI.setChecked(True)
elif settings.value("pythonConsole/autoCompleteSource") == 'fromDocAPI': elif settings.value("pythonConsole/autoCompleteSource") == 'fromDocAPI':
self.autoCompFromDocAPI.setChecked(True) self.autoCompFromDocAPI.setChecked(True)

if settings.value("pythonConsole/autoCompleteSourceEditor") == 'fromDoc': if settings.value("pythonConsole/autoCompleteSourceEditor") == 'fromDoc':
self.autoCompFromDocEditor.setChecked(True) self.autoCompFromDocEditor.setChecked(True)
elif settings.value("pythonConsole/autoCompleteSourceEditor") == 'fromAPI': elif settings.value("pythonConsole/autoCompleteSourceEditor") == 'fromAPI':
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/GdalTools/tools/doRasterize.py
Expand Up @@ -106,7 +106,7 @@ def fillOutputFileEdit(self):


self.outSelector.setFilename(outputFile) self.outSelector.setFilename(outputFile)


# required either -ts or -tr to create the output file # required either -ts or -tr to create the output file
if gdalVersion >= "1.8.0": if gdalVersion >= "1.8.0":
if not QFileInfo(outputFile).exists(): if not QFileInfo(outputFile).exists():
QMessageBox.information( self, self.tr( "Output size or resolution required" ), self.tr( "The output file doesn't exist. You must set up the output size or resolution to create it." ) ) QMessageBox.information( self, self.tr( "Output size or resolution required" ), self.tr( "The output file doesn't exist. You must set up the output size or resolution to create it." ) )
Expand All @@ -127,7 +127,7 @@ def getArguments(self):
arguments << str( self.vertresSpin.value() ) arguments << str( self.vertresSpin.value() )
inputFn = self.getInputFileName() inputFn = self.getInputFileName()
if not inputFn.isEmpty(): if not inputFn.isEmpty():
arguments << "-l" arguments << "-l"
arguments << QFileInfo( inputFn ).baseName() arguments << QFileInfo( inputFn ).baseName()
arguments << inputFn arguments << inputFn
arguments << self.getOutputFileName() arguments << self.getOutputFileName()
Expand Down

2 comments on commit d0aa1e4

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an automated command you used to clean all these files? I know about the prepare-commit script, but wasn't aware if there was a similar command for qgis python scripts.

@jef-n
Copy link
Member Author

@jef-n jef-n commented on d0aa1e4 May 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepare-commit also works for python files.

Please sign in to comment.