Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 3008
7848489bcb92
child 3145
a9de05d4a22f
--- a/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesQueueManagementDialog.py	Fri Oct 18 23:00:41 2013 +0200
@@ -14,8 +14,8 @@
     pass
 
 from PyQt4.QtCore import pyqtSlot, QProcess, QCoreApplication
-from PyQt4.QtGui import QDialog, QDialogButtonBox, QAbstractItemView, QListWidgetItem, \
-    QAbstractButton
+from PyQt4.QtGui import QDialog, QDialogButtonBox, QAbstractItemView, \
+    QListWidgetItem, QAbstractButton
 
 from .Ui_HgQueuesQueueManagementDialog import Ui_HgQueuesQueueManagementDialog
 
@@ -38,11 +38,12 @@
             HgQueuesQueueManagementDialog.NAME_INPUT,
             HgQueuesQueueManagementDialog.QUEUE_INPUT)
         @param title title for the dialog (string)
-        @param suppressActive flag indicating to not show the name of the active
-            queue (boolean)
+        @param suppressActive flag indicating to not show the name of the
+            active queue (boolean)
         @param repodir name of the repository directory (string)
         @param vcs reference to the vcs object
         @param parent reference to the parent widget (QWidget)
+        @exception ValueError raised to indicate an invalid dialog mode
         """
         super(HgQueuesQueueManagementDialog, self).__init__(parent)
         self.setupUi(self)
@@ -57,21 +58,26 @@
         self.__suppressActive = suppressActive
         self.__hgClient = vcs.getClient()
         
-        self.inputFrame.setHidden(mode != HgQueuesQueueManagementDialog.NAME_INPUT)
-        self.selectLabel.setHidden(mode != HgQueuesQueueManagementDialog.QUEUE_INPUT)
+        self.inputFrame.setHidden(
+            mode != HgQueuesQueueManagementDialog.NAME_INPUT)
+        self.selectLabel.setHidden(
+            mode != HgQueuesQueueManagementDialog.QUEUE_INPUT)
         if mode != HgQueuesQueueManagementDialog.QUEUE_INPUT:
             self.queuesList.setSelectionMode(QAbstractItemView.NoSelection)
         
         if mode == HgQueuesQueueManagementDialog.NO_INPUT:
-            self.buttonBox.removeButton(self.buttonBox.button(QDialogButtonBox.Ok))
-            self.buttonBox.removeButton(self.buttonBox.button(QDialogButtonBox.Cancel))
+            self.buttonBox.removeButton(
+                self.buttonBox.button(QDialogButtonBox.Ok))
+            self.buttonBox.removeButton(
+                self.buttonBox.button(QDialogButtonBox.Cancel))
             self.refreshButton = self.buttonBox.addButton(
                 self.trUtf8("Refresh"), QDialogButtonBox.ActionRole)
             self.refreshButton.setToolTip(
                 self.trUtf8("Press to refresh the queues list"))
             self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
         else:
-            self.buttonBox.removeButton(self.buttonBox.button(QDialogButtonBox.Close))
+            self.buttonBox.removeButton(
+                self.buttonBox.button(QDialogButtonBox.Close))
             self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
             self.refreshButton = None
         
@@ -84,10 +90,11 @@
     
     def __getQueuesList(self):
         """
-        Public method to get a list of all queues and the name of the active queue.
+        Public method to get a list of all queues and the name of the active
+        queue.
         
-        @return tuple with a list of all queues and the name of the active queue
-            (list of strings, string)
+        @return tuple with a list of all queues and the name of the active
+            queue (list of strings, string)
         """
         queuesList = []
         activeQueue = ""
@@ -108,8 +115,8 @@
             if procStarted:
                 finished = process.waitForFinished(30000)
                 if finished and process.exitCode() == 0:
-                    output = \
-                        str(process.readAllStandardOutput(), ioEncoding, 'replace')
+                    output = str(
+                        process.readAllStandardOutput(), ioEncoding, 'replace')
         
         for queue in output.splitlines():
             queue = queue.strip()
@@ -128,6 +135,8 @@
     def on_nameEdit_textChanged(self, txt):
         """
         Private slot to handle changes of the entered queue name.
+        
+        @param txt text of the edit (string)
         """
         if self.__mode == HgQueuesQueueManagementDialog.NAME_INPUT:
             self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(txt != "")

eric ide

mercurial