Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2847
1843ef6e2656
parent 3008
7848489bcb92
child 3145
a9de05d4a22f
--- a/Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/ConfigurationPage/MercurialPage.py	Fri Oct 18 23:00:41 2013 +0200
@@ -14,7 +14,8 @@
 from PyQt4.QtCore import pyqtSlot
 from PyQt4.QtGui import QDialog
 
-from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
+from Preferences.ConfigurationPages.ConfigurationPageBase import \
+    ConfigurationPageBase
 from .Ui_MercurialPage import Ui_MercurialPage
 
 
@@ -35,27 +36,39 @@
         self.__plugin = plugin
         
         # set initial values
-        self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit"))
-        self.commitSpinBox.setValue(self.__plugin.getPreferences("CommitMessages"))
-        self.logBrowserCheckBox.setChecked(self.__plugin.getPreferences("UseLogBrowser"))
-        self.pullUpdateCheckBox.setChecked(self.__plugin.getPreferences("PullUpdate"))
+        self.logSpinBox.setValue(
+            self.__plugin.getPreferences("LogLimit"))
+        self.commitSpinBox.setValue(
+            self.__plugin.getPreferences("CommitMessages"))
+        self.logBrowserCheckBox.setChecked(
+            self.__plugin.getPreferences("UseLogBrowser"))
+        self.pullUpdateCheckBox.setChecked(
+            self.__plugin.getPreferences("PullUpdate"))
         self.preferUnbundleCheckBox.setChecked(
             self.__plugin.getPreferences("PreferUnbundle"))
-        self.cleanupPatternEdit.setText(self.__plugin.getPreferences("CleanupPatterns"))
-        self.backupCheckBox.setChecked(self.__plugin.getPreferences("CreateBackup"))
+        self.cleanupPatternEdit.setText(
+            self.__plugin.getPreferences("CleanupPatterns"))
+        self.backupCheckBox.setChecked(
+            self.__plugin.getPreferences("CreateBackup"))
     
     def save(self):
         """
         Public slot to save the Mercurial configuration.
         """
-        self.__plugin.setPreferences("LogLimit", self.logSpinBox.value())
-        self.__plugin.setPreferences("CommitMessages", self.commitSpinBox.value())
-        self.__plugin.setPreferences("UseLogBrowser", self.logBrowserCheckBox.isChecked())
-        self.__plugin.setPreferences("PullUpdate", self.pullUpdateCheckBox.isChecked())
-        self.__plugin.setPreferences("PreferUnbundle",
-            self.preferUnbundleCheckBox.isChecked())
-        self.__plugin.setPreferences("CleanupPatterns", self.cleanupPatternEdit.text())
-        self.__plugin.setPreferences("CreateBackup", self.backupCheckBox.isChecked())
+        self.__plugin.setPreferences(
+            "LogLimit", self.logSpinBox.value())
+        self.__plugin.setPreferences(
+            "CommitMessages", self.commitSpinBox.value())
+        self.__plugin.setPreferences(
+            "UseLogBrowser", self.logBrowserCheckBox.isChecked())
+        self.__plugin.setPreferences(
+            "PullUpdate", self.pullUpdateCheckBox.isChecked())
+        self.__plugin.setPreferences(
+            "PreferUnbundle", self.preferUnbundleCheckBox.isChecked())
+        self.__plugin.setPreferences(
+            "CleanupPatterns", self.cleanupPatternEdit.text())
+        self.__plugin.setPreferences(
+            "CreateBackup", self.backupCheckBox.isChecked())
     
     @pyqtSlot()
     def on_configButton_clicked(self):
@@ -78,7 +91,8 @@
                     username = email
             try:
                 f = open(cfgFile, "w")
-                f.write(os.linesep.join(["[ui]", "username = {0}".format(username), ""]))
+                f.write(os.linesep.join(["[ui]",
+                        "username = {0}".format(username), ""]))
                 f.close()
             except (IOError, OSError):
                 # ignore these

eric ide

mercurial