--- a/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py Tue Oct 15 22:03:54 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/ProjectBrowserHelper.py Fri Oct 18 23:00:41 2013 +0200 @@ -25,21 +25,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): """ @@ -49,8 +50,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: @@ -84,8 +85,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() @@ -125,8 +126,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: @@ -151,8 +152,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() @@ -181,9 +182,9 @@ for act in standardItems: act.setEnabled(True) - ############################################################################ + ########################################################################### # Protected menu generation methods below - ############################################################################ + ########################################################################### def _addVCSMenu(self, mainMenu): """ @@ -198,7 +199,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) @@ -218,7 +220,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) @@ -279,7 +282,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() @@ -298,7 +302,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) @@ -332,7 +337,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) @@ -387,7 +393,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() @@ -406,7 +413,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) @@ -436,7 +444,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) @@ -474,7 +483,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) @@ -539,12 +549,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) @@ -580,7 +592,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) @@ -633,12 +646,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) @@ -658,9 +673,9 @@ mainMenu.addMenu(menu) self.menuDirMulti = menu - ############################################################################ + ########################################################################### # Menu handling methods below - ############################################################################ + ########################################################################### def __SVNCopy(self): """ @@ -705,8 +720,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(): @@ -718,7 +733,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(): @@ -730,7 +746,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(): @@ -742,8 +759,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. """ @@ -757,8 +774,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. """ @@ -772,8 +789,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() @@ -781,8 +798,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() @@ -790,7 +809,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: @@ -811,8 +831,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: @@ -823,7 +843,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(): @@ -835,7 +856,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(): @@ -847,7 +869,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(): @@ -861,7 +884,8 @@ """ Private method to open the configuration dialog. """ - e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") + e5App().getObject("UserInterface")\ + .showPreferences("zzz_subversionPage") def __SVNAddToChangelist(self): """ @@ -877,7 +901,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(): @@ -887,9 +912,9 @@ names.append(itm.dirName()) self.vcs.svnRemoveFromChangelist(names) - ############################################################################ + ########################################################################### # Some private utility methods below - ############################################################################ + ########################################################################### def __itemsHaveFiles(self, items): """