Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py

changeset 3009
bf5ae5d7477d
parent 2845
7e55c6268c35
child 3019
7912530a33e2
child 3057
10516539f238
diff -r 7848489bcb92 -r bf5ae5d7477d Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py
--- a/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py	Sat Oct 12 15:01:28 2013 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py	Sat Oct 12 17:31:40 2013 +0200
@@ -23,21 +23,22 @@
     """
     Class implementing the VCS project browser helper for subversion.
     """
-    def __init__(self, vcsObject, browserObject, projectObject, isTranslationsBrowser,
-        parent=None, name=None):
+    def __init__(self, vcsObject, browserObject, projectObject,
+                 isTranslationsBrowser, parent=None, name=None):
         """
         Constructor
         
         @param vcsObject reference to the vcs object
         @param browserObject reference to the project browser object
         @param projectObject reference to the project object
-        @param isTranslationsBrowser flag indicating, the helper is requested for the
-            translations browser (this needs some special treatment)
+        @param isTranslationsBrowser flag indicating, the helper is requested
+            for the translations browser (this needs some special treatment)
         @param parent parent widget (QWidget)
         @param name name of this object (string)
         """
-        VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject, projectObject,
-            isTranslationsBrowser, parent, name)
+        VcsProjectBrowserHelper.__init__(self, vcsObject, browserObject,
+                                         projectObject, isTranslationsBrowser,
+                                         parent, name)
     
     def showContextMenu(self, menu, standardItems):
         """
@@ -47,8 +48,8 @@
         VCS status and the file status.
         
         @param menu reference to the menu to be shown
-        @param standardItems array of standard items that need activation/deactivation
-            depending on the overall VCS status
+        @param standardItems array of standard items that need
+            activation/deactivation depending on the overall VCS status
         """
         if self.browser.currentItem().data(1) == self.vcs.vcsName():
             for act in self.vcsMenuActions:
@@ -82,8 +83,8 @@
         VCS status and the files status.
         
         @param menu reference to the menu to be shown
-        @param standardItems array of standard items that need activation/deactivation
-            depending on the overall VCS status
+        @param standardItems array of standard items that need
+            activation/deactivation depending on the overall VCS status
         """
         vcsName = self.vcs.vcsName()
         items = self.browser.getSelectedItems()
@@ -123,8 +124,8 @@
         VCS status and the directory status.
         
         @param menu reference to the menu to be shown
-        @param standardItems array of standard items that need activation/deactivation
-            depending on the overall VCS status
+        @param standardItems array of standard items that need
+            activation/deactivation depending on the overall VCS status
         """
         if self.browser.currentItem().data(1) == self.vcs.vcsName():
             for act in self.vcsDirMenuActions:
@@ -149,8 +150,8 @@
         VCS status and the directory status.
         
         @param menu reference to the menu to be shown
-        @param standardItems array of standard items that need activation/deactivation
-            depending on the overall VCS status
+        @param standardItems array of standard items that need
+            activation/deactivation depending on the overall VCS status
         """
         vcsName = self.vcs.vcsName()
         items = self.browser.getSelectedItems()
@@ -179,9 +180,9 @@
             for act in standardItems:
                 act.setEnabled(True)
 
-    ############################################################################
+    ###########################################################################
     # Protected menu generation methods below
-    ############################################################################
+    ###########################################################################
 
     def _addVCSMenu(self, mainMenu):
         """
@@ -196,7 +197,8 @@
         
         act = menu.addAction(
             UI.PixmapCache.getIcon(
-                os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
+                os.path.join("VcsPlugins", "vcsSubversion", "icons",
+                             "subversion.png")),
             self.vcs.vcsName(), self._VCSInfoDisplay)
         font = act.font()
         font.setBold(True)
@@ -216,7 +218,8 @@
             self._VCSAdd)
         self.vcsAddMenuActions.append(act)
         if 1 in self.browser.specialMenuEntries:
-            self.vcsMenuAddTree = menu.addAction(UI.PixmapCache.getIcon("vcsAdd.png"),
+            self.vcsMenuAddTree = menu.addAction(
+                UI.PixmapCache.getIcon("vcsAdd.png"),
                 self.trUtf8('Add tree to repository'),
                 self._VCSAddTree)
             self.vcsAddMenuActions.append(self.vcsMenuAddTree)
@@ -277,7 +280,8 @@
         act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
             self.trUtf8('Merge changes'), self._VCSMerge)
         self.vcsMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve)
+        act = menu.addAction(
+            self.trUtf8('Conflict resolved'), self.__SVNResolve)
         self.vcsMenuActions.append(act)
         if self.vcs.version >= (1, 2, 0):
             menu.addSeparator()
@@ -296,7 +300,8 @@
         menu.addSeparator()
         act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
         self.vcsMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps)
+        act = menu.addAction(
+            self.trUtf8('List Properties'), self.__SVNListProps)
         self.vcsMenuActions.append(act)
         act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
         self.vcsMenuActions.append(act)
@@ -330,7 +335,8 @@
         
         act = menu.addAction(
             UI.PixmapCache.getIcon(
-                os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
+                os.path.join("VcsPlugins", "vcsSubversion", "icons",
+                             "subversion.png")),
             self.vcs.vcsName(), self._VCSInfoDisplay)
         font = act.font()
         font.setBold(True)
@@ -385,7 +391,8 @@
         act = menu.addAction(UI.PixmapCache.getIcon("vcsRevert.png"),
             self.trUtf8('Revert changes'), self._VCSRevert)
         self.vcsMultiMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve)
+        act = menu.addAction(
+            self.trUtf8('Conflict resolved'), self.__SVNResolve)
         self.vcsMultiMenuActions.append(act)
         if self.vcs.version >= (1, 2, 0):
             menu.addSeparator()
@@ -404,7 +411,8 @@
         menu.addSeparator()
         act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
         self.vcsMultiMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps)
+        act = menu.addAction(
+            self.trUtf8('List Properties'), self.__SVNListProps)
         self.vcsMultiMenuActions.append(act)
         act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
         self.vcsMultiMenuActions.append(act)
@@ -434,7 +442,8 @@
         
         act = menu.addAction(
             UI.PixmapCache.getIcon(
-                os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
+                os.path.join("VcsPlugins", "vcsSubversion", "icons",
+                             "subversion.png")),
             self.vcs.vcsName(), self._VCSInfoDisplay)
         font = act.font()
         font.setBold(True)
@@ -472,7 +481,8 @@
         
         act = menu.addAction(
             UI.PixmapCache.getIcon(
-                os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
+                os.path.join("VcsPlugins", "vcsSubversion", "icons",
+                             "subversion.png")),
             self.vcs.vcsName(), self._VCSInfoDisplay)
         font = act.font()
         font.setBold(True)
@@ -537,12 +547,14 @@
         act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
             self.trUtf8('Merge changes'), self._VCSMerge)
         self.vcsDirMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve)
+        act = menu.addAction(
+            self.trUtf8('Conflict resolved'), self.__SVNResolve)
         self.vcsDirMenuActions.append(act)
         menu.addSeparator()
         act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
         self.vcsDirMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps)
+        act = menu.addAction(
+            self.trUtf8('List Properties'), self.__SVNListProps)
         self.vcsDirMenuActions.append(act)
         act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
         self.vcsDirMenuActions.append(act)
@@ -578,7 +590,8 @@
         
         act = menu.addAction(
             UI.PixmapCache.getIcon(
-                os.path.join("VcsPlugins", "vcsSubversion", "icons", "subversion.png")),
+                os.path.join("VcsPlugins", "vcsSubversion", "icons",
+                             "subversion.png")),
             self.vcs.vcsName(), self._VCSInfoDisplay)
         font = act.font()
         font.setBold(True)
@@ -631,12 +644,14 @@
         act = menu.addAction(UI.PixmapCache.getIcon("vcsMerge.png"),
             self.trUtf8('Merge changes'), self._VCSMerge)
         self.vcsDirMultiMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('Conflict resolved'), self.__SVNResolve)
+        act = menu.addAction(
+            self.trUtf8('Conflict resolved'), self.__SVNResolve)
         self.vcsDirMultiMenuActions.append(act)
         menu.addSeparator()
         act = menu.addAction(self.trUtf8('Set Property'), self.__SVNSetProp)
         self.vcsDirMultiMenuActions.append(act)
-        act = menu.addAction(self.trUtf8('List Properties'), self.__SVNListProps)
+        act = menu.addAction(
+            self.trUtf8('List Properties'), self.__SVNListProps)
         self.vcsDirMultiMenuActions.append(act)
         act = menu.addAction(self.trUtf8('Delete Property'), self.__SVNDelProp)
         self.vcsDirMultiMenuActions.append(act)
@@ -656,9 +671,9 @@
         mainMenu.addMenu(menu)
         self.menuDirMulti = menu
     
-    ############################################################################
+    ###########################################################################
     # Menu handling methods below
-    ############################################################################
+    ###########################################################################
     
     def __SVNCopy(self):
         """
@@ -703,8 +718,8 @@
         
     def __SVNListProps(self):
         """
-        Private slot called by the context menu to list the subversion properties of
-        a file.
+        Private slot called by the context menu to list the subversion
+        properties of a file.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -716,7 +731,8 @@
         
     def __SVNSetProp(self):
         """
-        Private slot called by the context menu to set a subversion property of a file.
+        Private slot called by the context menu to set a subversion property
+        of a file.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -728,7 +744,8 @@
         
     def __SVNDelProp(self):
         """
-        Private slot called by the context menu to delete a subversion property of a file.
+        Private slot called by the context menu to delete a subversion
+        property of a file.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -740,8 +757,8 @@
         
     def __SVNExtendedDiff(self):
         """
-        Private slot called by the context menu to show the difference of a file to
-        the repository.
+        Private slot called by the context menu to show the difference of a
+        file to the repository.
         
         This gives the chance to enter the revisions to compare.
         """
@@ -755,8 +772,8 @@
         
     def __SVNUrlDiff(self):
         """
-        Private slot called by the context menu to show the difference of a file of
-        two repository URLs.
+        Private slot called by the context menu to show the difference of a
+        file of two repository URLs.
         
         This gives the chance to enter the repository URLs to compare.
         """
@@ -770,8 +787,8 @@
         
     def __SVNSbsDiff(self):
         """
-        Private slot called by the context menu to show the difference of a file to
-        the repository side-by-side.
+        Private slot called by the context menu to show the difference of a
+        file to the repository side-by-side.
         """
         itm = self.browser.currentItem()
         fn = itm.fileName()
@@ -779,8 +796,10 @@
     
     def __SVNSbsExtendedDiff(self):
         """
-        Private slot called by the context menu to show the difference of a file to
-        the repository side-by-side allowing the selection of revisions to compare.
+        Private slot called by the context menu to show the difference of a
+        file to the repository side-by-side.
+       
+        It allows the selection of revisions to compare.
         """
         itm = self.browser.currentItem()
         fn = itm.fileName()
@@ -788,7 +807,8 @@
     
     def __SVNLogBrowser(self):
         """
-        Private slot called by the context menu to show the log browser for a file.
+        Private slot called by the context menu to show the log browser for
+        a file.
         """
         itm = self.browser.currentItem()
         try:
@@ -809,8 +829,8 @@
         
     def __SVNLock(self):
         """
-        Private slot called by the context menu to lock files in the repository.
-        """
+        Private slot called by the context menu to lock files in the
+        repository. """
         names = []
         for itm in self.browser.getSelectedItems():
             try:
@@ -821,7 +841,8 @@
         
     def __SVNUnlock(self):
         """
-        Private slot called by the context menu to unlock files in the repository.
+        Private slot called by the context menu to unlock files in the
+        repository.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -833,7 +854,8 @@
         
     def __SVNBreakLock(self):
         """
-        Private slot called by the context menu to break lock files in the repository.
+        Private slot called by the context menu to break lock files in the
+        repository.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -845,7 +867,8 @@
         
     def __SVNStealLock(self):
         """
-        Private slot called by the context menu to steal lock files in the repository.
+        Private slot called by the context menu to steal lock files in the
+        repository.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -859,7 +882,8 @@
         """
         Private method to open the configuration dialog.
         """
-        e5App().getObject("UserInterface").showPreferences("zzz_subversionPage")
+        e5App().getObject("UserInterface")\
+            .showPreferences("zzz_subversionPage")
         
     def __SVNAddToChangelist(self):
         """
@@ -875,7 +899,8 @@
         
     def __SVNRemoveFromChangelist(self):
         """
-        Private slot called by the context menu to remove files from their changelist.
+        Private slot called by the context menu to remove files from their
+        changelist.
         """
         names = []
         for itm in self.browser.getSelectedItems():
@@ -885,9 +910,9 @@
                 names.append(itm.dirName())
         self.vcs.svnRemoveFromChangelist(names)
 
-    ############################################################################
+    ###########################################################################
     # Some private utility methods below
-    ############################################################################
+    ###########################################################################
     
     def __itemsHaveFiles(self, items):
         """

eric ide

mercurial