Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PEP8

  • Loading branch information...
commit 2e56dbf2b76b004c247319ff0e813e41ebb37c09 1 parent 7299da1
@timlinux timlinux authored
Showing with 31 additions and 18 deletions.
  1. +1 −1  .idea/inasafe-dev.iml
  2. +30 −17 safe_qgis/plugin.py
View
2  .idea/inasafe-dev.iml
@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
- <orderEntry type="jdk" jdkName="Python with QGIS 1.8 libs" jdkType="Python SDK" />
+ <orderEntry type="jdk" jdkName="Python with QGIS-Master libs" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PackageRequirementsSettings">
View
47 safe_qgis/plugin.py
@@ -90,8 +90,9 @@ def setupI18n(self, thePreferredLocale=None):
Raises:
TranslationLoadException
"""
- myOverrideFlag = QSettings().value('locale/overrideFlag',
- QVariant(False)).toBool()
+ myOverrideFlag = QSettings().value(
+ 'locale/overrideFlag',
+ QVariant(False)).toBool()
if thePreferredLocale is not None:
myLocaleName = thePreferredLocale
@@ -109,12 +110,17 @@ def setupI18n(self, thePreferredLocale=None):
# .. see:: :py:func:`common.utilities`
os.environ['LANG'] = str(myLocaleName)
- LOGGER.debug('%s %s %s %s' % (thePreferredLocale , myOverrideFlag,
- QLocale.system().name(),
- os.environ['LANG']))
+ LOGGER.debug('%s %s %s %s' % (
+ thePreferredLocale,
+ myOverrideFlag,
+ QLocale.system().name(),
+ os.environ['LANG']))
+
myRoot = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
- myTranslationPath = os.path.join(myRoot, 'safe_qgis', 'i18n',
- 'inasafe_' + str(myLocaleName) + '.qm')
+ myTranslationPath = os.path.join(
+ myRoot, 'safe_qgis', 'i18n',
+ 'inasafe_' + str(myLocaleName) + '.qm')
+
if os.path.exists(myTranslationPath):
self.translator = QTranslator()
myResult = self.translator.load(myTranslationPath)
@@ -122,8 +128,10 @@ def setupI18n(self, thePreferredLocale=None):
myMessage = 'Failed to load translation for %s' % myLocaleName
raise TranslationLoadError(myMessage)
QCoreApplication.installTranslator(self.translator)
- LOGGER.debug('%s %s' % (myTranslationPath,
- os.path.exists(myTranslationPath)))
+
+ LOGGER.debug('%s %s' % (
+ myTranslationPath,
+ os.path.exists(myTranslationPath)))
def tr(self, theString):
"""We implement this ourself since we do not inherit QObject.
@@ -346,7 +354,8 @@ def unload(self):
self.iface.mainWindow().removeDockWidget(self.dockWidget)
self.dockWidget.setVisible(False)
self.dockWidget.destroy()
- QObject.disconnect(self.iface,
+ QObject.disconnect(
+ self.iface,
SIGNAL("currentLayerChanged(QgsMapLayer*)"),
self.layerChanged)
@@ -430,9 +439,10 @@ def showOptions(self):
# import here only so that it is AFTER i18n set up
from safe_qgis.options_dialog import OptionsDialog
- myDialog = OptionsDialog(self.iface.mainWindow(),
- self.iface,
- self.dockWidget)
+ myDialog = OptionsDialog(
+ self.iface.mainWindow(),
+ self.iface,
+ self.dockWidget)
myDialog.show()
def showKeywordsEditor(self):
@@ -445,8 +455,10 @@ def showKeywordsEditor(self):
Args:
None.
+
Returns:
None.
+
Raises:
no exceptions explicitly raised.
"""
@@ -455,9 +467,10 @@ def showKeywordsEditor(self):
if self.iface.activeLayer() is None:
return
- myDialog = KeywordsDialog(self.iface.mainWindow(),
- self.iface,
- self.dockWidget)
+ myDialog = KeywordsDialog(
+ self.iface.mainWindow(),
+ self.iface,
+ self.dockWidget)
myDialog.setModal(True)
myDialog.show()
@@ -521,5 +534,5 @@ def layerChanged(self, theLayer):
self.dockWidget.layerChanged(theLayer)
def keyActionF7(self):
- '''Executed when user press F7'''
+ """Executed when user press F7"""
self.showImpactFunctionsDoc()
Please sign in to comment.
Something went wrong with that request. Please try again.