Sat, 12 Oct 2013 17:31:40 +0200
Continued to shorten the code lines to max. 79 characters.
--- a/Plugins/VcsPlugins/vcsPySvn/ConfigurationPage/SubversionPage.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/ConfigurationPage/SubversionPage.py Sat Oct 12 17:31:40 2013 +0200 @@ -9,7 +9,8 @@ from PyQt4.QtCore import pyqtSlot -from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase +from Preferences.ConfigurationPages.ConfigurationPageBase import \ + ConfigurationPageBase from .Ui_SubversionPage import Ui_SubversionPage @@ -31,14 +32,16 @@ # set initial values self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit")) - self.commitSpinBox.setValue(self.__plugin.getPreferences("CommitMessages")) + self.commitSpinBox.setValue( + self.__plugin.getPreferences("CommitMessages")) def save(self): """ Public slot to save the Subversion configuration. """ self.__plugin.setPreferences("LogLimit", self.logSpinBox.value()) - self.__plugin.setPreferences("CommitMessages", self.commitSpinBox.value()) + self.__plugin.setPreferences( + "CommitMessages", self.commitSpinBox.value()) @pyqtSlot() def on_configButton_clicked(self):
--- a/Plugins/VcsPlugins/vcsPySvn/ProjectBrowserHelper.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/ProjectBrowserHelper.py Sat Oct 12 17:31:40 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): """ @@ -218,7 +219,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) @@ -282,7 +284,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) menu.addSeparator() act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), @@ -300,7 +303,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) @@ -389,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) menu.addSeparator() act = menu.addAction(UI.PixmapCache.getIcon("vcsLock.png"), @@ -407,7 +412,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) @@ -543,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) @@ -637,12 +645,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) @@ -662,9 +672,9 @@ mainMenu.addMenu(menu) self.menuDirMulti = menu - ############################################################################ + ########################################################################### # Menu handling methods below - ############################################################################ + ########################################################################### def __SVNCopy(self): """ @@ -709,8 +719,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(): @@ -722,7 +732,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(): @@ -734,7 +745,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(): @@ -746,8 +758,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. """ @@ -761,8 +773,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. """ @@ -776,8 +788,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() @@ -785,8 +797,9 @@ 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 allowing the selection of + revisions to compare. """ itm = self.browser.currentItem() fn = itm.fileName() @@ -794,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: @@ -815,7 +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(): @@ -827,7 +842,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(): @@ -839,7 +855,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(): @@ -851,7 +868,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(): @@ -863,8 +881,8 @@ def __SVNInfo(self): """ - Private slot called by the context menu to show repository information of - a file or directory. + Private slot called by the context menu to show repository information + of a file or directory. """ try: name = self.browser.currentItem().fileName() @@ -877,7 +895,8 @@ """ Private method to open the configuration dialog. """ - e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") + e5App().getObject("UserInterface")\ + .showPreferences("zzz_subversionPage") def __SVNAddToChangelist(self): """ @@ -893,7 +912,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(): @@ -903,9 +923,9 @@ names.append(itm.dirName()) self.vcs.svnRemoveFromChangelist(names) - ############################################################################ + ########################################################################### # Some private utility methods below - ############################################################################ + ########################################################################### def __itemsHaveFiles(self, items): """
--- a/Plugins/VcsPlugins/vcsPySvn/ProjectHelper.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/ProjectHelper.py Sat Oct 12 17:31:40 2013 +0200 @@ -45,15 +45,18 @@ """ Public method to generate the action objects. """ - self.vcsNewAct = E5Action(self.trUtf8('New from repository'), - UI.PixmapCache.getIcon("vcsCheckout.png"), - self.trUtf8('&New from repository...'), 0, 0, self, 'subversion_new') + self.vcsNewAct = E5Action( + self.trUtf8('New from repository'), + UI.PixmapCache.getIcon("vcsCheckout.png"), + self.trUtf8('&New from repository...'), 0, 0, self, + 'subversion_new') self.vcsNewAct.setStatusTip(self.trUtf8( 'Create a new project from the VCS repository' )) self.vcsNewAct.setWhatsThis(self.trUtf8( """<b>New from repository</b>""" - """<p>This creates a new local project from the VCS repository.</p>""" + """<p>This creates a new local project from the VCS""" + """ repository.</p>""" )) self.vcsNewAct.triggered[()].connect(self._vcsCheckout) self.actions.append(self.vcsNewAct) @@ -67,21 +70,24 @@ )) self.vcsUpdateAct.setWhatsThis(self.trUtf8( """<b>Update from repository</b>""" - """<p>This updates the local project from the VCS repository.</p>""" + """<p>This updates the local project from the VCS""" + """ repository.</p>""" )) self.vcsUpdateAct.triggered[()].connect(self._vcsUpdate) self.actions.append(self.vcsUpdateAct) - self.vcsCommitAct = E5Action(self.trUtf8('Commit changes to repository'), - UI.PixmapCache.getIcon("vcsCommit.png"), - self.trUtf8('&Commit changes to repository...'), 0, 0, self, - 'subversion_commit') + self.vcsCommitAct = E5Action( + self.trUtf8('Commit changes to repository'), + UI.PixmapCache.getIcon("vcsCommit.png"), + self.trUtf8('&Commit changes to repository...'), 0, 0, self, + 'subversion_commit') self.vcsCommitAct.setStatusTip(self.trUtf8( 'Commit changes to the local project to the VCS repository' )) self.vcsCommitAct.setWhatsThis(self.trUtf8( """<b>Commit changes to repository</b>""" - """<p>This commits changes to the local project to the VCS repository.</p>""" + """<p>This commits changes to the local project to the VCS""" + """ repository.</p>""" )) self.vcsCommitAct.triggered[()].connect(self._vcsCommit) self.actions.append(self.vcsCommitAct) @@ -109,9 +115,9 @@ )) self.svnLogBrowserAct.setWhatsThis(self.trUtf8( """<b>Show log browser</b>""" - """<p>This shows a dialog to browse the log of the local project.""" - """ A limited number of entries is shown first. More can be""" - """ retrieved later on.</p>""" + """<p>This shows a dialog to browse the log of the local""" + """ project. A limited number of entries is shown first. More""" + """ can be retrieved later on.</p>""" )) self.svnLogBrowserAct.triggered[()].connect(self.__svnLogBrowser) self.actions.append(self.svnLogBrowserAct) @@ -125,21 +131,24 @@ )) self.vcsDiffAct.setWhatsThis(self.trUtf8( """<b>Show difference</b>""" - """<p>This shows the difference of the local project to the repository.</p>""" + """<p>This shows the difference of the local project to the""" + """ repository.</p>""" )) self.vcsDiffAct.triggered[()].connect(self._vcsDiff) self.actions.append(self.vcsDiffAct) - self.svnExtDiffAct = E5Action(self.trUtf8('Show difference (extended)'), - UI.PixmapCache.getIcon("vcsDiff.png"), - self.trUtf8('Show difference (extended)'), - 0, 0, self, 'subversion_extendeddiff') + self.svnExtDiffAct = E5Action( + self.trUtf8('Show difference (extended)'), + UI.PixmapCache.getIcon("vcsDiff.png"), + self.trUtf8('Show difference (extended)'), + 0, 0, self, 'subversion_extendeddiff') self.svnExtDiffAct.setStatusTip(self.trUtf8( 'Show the difference of revisions of the project to the repository' )) self.svnExtDiffAct.setWhatsThis(self.trUtf8( """<b>Show difference (extended)</b>""" - """<p>This shows the difference of selectable revisions of the project.</p>""" + """<p>This shows the difference of selectable revisions of""" + """ the project.</p>""" )) self.svnExtDiffAct.triggered[()].connect(self.__svnExtendedDiff) self.actions.append(self.svnExtDiffAct) @@ -234,7 +243,8 @@ self.vcsPropsAct = E5Action(self.trUtf8('Command options'), self.trUtf8('Command &options...'), 0, 0, self, 'subversion_options') - self.vcsPropsAct.setStatusTip(self.trUtf8('Show the VCS command options')) + self.vcsPropsAct.setStatusTip(self.trUtf8( + 'Show the VCS command options')) self.vcsPropsAct.setWhatsThis(self.trUtf8( """<b>Command options...</b>""" """<p>This shows a dialog to edit the VCS command options.</p>""" @@ -265,7 +275,8 @@ )) self.vcsMergeAct.setWhatsThis(self.trUtf8( """<b>Merge</b>""" - """<p>This merges changes of a tag/revision into the local project.</p>""" + """<p>This merges changes of a tag/revision into the local""" + """ project.</p>""" )) self.vcsMergeAct.triggered[()].connect(self._vcsMerge) self.actions.append(self.vcsMergeAct) @@ -292,7 +303,8 @@ )) self.vcsResolveAct.setWhatsThis(self.trUtf8( """<b>Conflicts resolved</b>""" - """<p>This marks all conflicts of the local project as resolved.</p>""" + """<p>This marks all conflicts of the local project as""" + """ resolved.</p>""" )) self.vcsResolveAct.triggered[()].connect(self.__svnResolve) self.actions.append(self.vcsResolveAct) @@ -410,7 +422,8 @@ )) self.svnRelocateAct.setWhatsThis(self.trUtf8( """<b>Relocate</b>""" - """<p>This relocates the working copy to a new repository URL.</p>""" + """<p>This relocates the working copy to a new repository""" + """ URL.</p>""" )) self.svnRelocateAct.triggered[()].connect(self.__svnRelocate) self.actions.append(self.svnRelocateAct) @@ -437,7 +450,8 @@ )) self.svnConfigAct.setWhatsThis(self.trUtf8( """<b>Configure</b>""" - """<p>Show the configuration dialog with the Subversion page selected.</p>""" + """<p>Show the configuration dialog with the Subversion page""" + """ selected.</p>""" )) self.svnConfigAct.triggered[()].connect(self.__svnConfigure) self.actions.append(self.svnConfigAct) @@ -541,13 +555,15 @@ def __svnExtendedDiff(self): """ - Private slot used to perform a svn diff with the selection of revisions. + Private slot used to perform a svn diff with the selection of + revisions. """ self.vcs.svnExtendedDiff(self.project.ppath) def __svnUrlDiff(self): """ - Private slot used to perform a svn diff with the selection of repository URLs. + Private slot used to perform a svn diff with the selection of + repository URLs. """ self.vcs.svnUrlDiff(self.project.ppath) @@ -579,7 +595,8 @@ """ Private slot to open the configuration dialog. """ - e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") + e5App().getObject("UserInterface")\ + .showPreferences("zzz_subversionPage") def __svnChangeLists(self): """
--- a/Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -12,7 +12,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, Qt -from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, QTreeWidgetItem +from PyQt4.QtGui import QHeaderView, QDialog, QDialogButtonBox, QFont, \ + QTreeWidgetItem from .SvnDialogMixin import SvnDialogMixin from .Ui_SvnBlameDialog import Ui_SvnBlameDialog @@ -74,8 +75,9 @@ annotations = self.client.annotate(fname) locker.unlock() for annotation in annotations: - self.__generateItem(annotation["revision"].number, - annotation["author"], annotation["number"] + 1, annotation["line"]) + self.__generateItem( + annotation["revision"].number, annotation["author"], + annotation["number"] + 1, annotation["line"]) except pysvn.ClientError as e: locker.unlock() self.__showError(e.args[0] + '\n') @@ -84,7 +86,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -12,8 +12,8 @@ import pysvn from PyQt4.QtCore import pyqtSlot, Qt, QMutexLocker -from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, QApplication, \ - QCursor +from PyQt4.QtGui import QDialog, QDialogButtonBox, QListWidgetItem, \ + QApplication, QCursor from .SvnDialogMixin import SvnDialogMixin @@ -60,7 +60,8 @@ if current is not None: changelist = current.text() if changelist in self.changeListsDict: - self.filesList.addItems(sorted(self.changeListsDict[changelist])) + self.filesList.addItems( + sorted(self.changeListsDict[changelist])) def start(self, path): """ @@ -71,14 +72,16 @@ self.changeListsDict = {} self.cancelled = False - self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) + self.filesLabel.setText( + self.trUtf8("Files (relative to {0}):").format(path)) QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) QApplication.processEvents() locker = QMutexLocker(self.vcs.vcsExecutionMutex) try: - entries = self.client.get_changelist(path, depth=pysvn.depth.infinity) + entries = self.client.get_changelist( + path, depth=pysvn.depth.infinity) for entry in entries: file = entry[0] changelist = entry[1] @@ -105,7 +108,8 @@ if len(self.changeListsDict) == 0: self.changeLists.addItem(self.trUtf8("No changelists found")) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) else: self.changeLists.setCurrentRow(0) self.changeLists.setFocus(Qt.OtherFocusReason)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnCopyDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnCopyDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -22,7 +22,8 @@ class SvnCopyDialog(QDialog, Ui_SvnCopyDialog): """ - Class implementing a dialog to enter the data for a copy or rename operation. + Class implementing a dialog to enter the data for a copy or rename + operation. """ def __init__(self, source, parent=None, move=False, force=False): """ @@ -63,7 +64,8 @@ if not os.path.isabs(target): sourceDir = os.path.dirname(self.sourceEdit.text()) target = os.path.join(sourceDir, target) - return Utilities.toNativeSeparators(target), self.forceCheckBox.isChecked() + return (Utilities.toNativeSeparators(target), + self.forceCheckBox.isChecked()) @pyqtSlot() def on_dirButton_clicked(self):
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -73,7 +73,8 @@ """ msg = "" if eventDict["action"] == pysvn.wc_notify_action.update_completed: - msg = self.trUtf8("Revision {0}.\n").format(eventDict["revision"].number) + msg = self.trUtf8("Revision {0}.\n").format( + eventDict["revision"].number) elif eventDict["path"] != "" and \ eventDict["action"] in svnNotifyActionMap and \ svnNotifyActionMap[eventDict["action"]] is not None: @@ -85,10 +86,12 @@ mime) if '.e4p' in eventDict["path"]: self.__hasAddOrDelete = True - if eventDict["action"] in \ - [pysvn.wc_notify_action.add, pysvn.wc_notify_action.commit_added, - pysvn.wc_notify_action.commit_deleted, pysvn.wc_notify_action.delete, - pysvn.wc_notify_action.update_add, pysvn.wc_notify_action.update_delete]: + if eventDict["action"] in [pysvn.wc_notify_action.add, + pysvn.wc_notify_action.commit_added, + pysvn.wc_notify_action.commit_deleted, + pysvn.wc_notify_action.delete, + pysvn.wc_notify_action.update_add, + pysvn.wc_notify_action.update_delete]: self.__hasAddOrDelete = True if msg: self.showMessage(msg) @@ -116,7 +119,8 @@ def finish(self): """ - Public slot called when the process finished or the user pressed the button. + Public slot called when the process finished or the user pressed the + button. """ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to show the output of the svn diff command process. +Module implementing a dialog to show the output of the svn diff command +process. """ import os @@ -12,8 +13,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, QFileInfo, QDateTime, Qt, pyqtSlot -from PyQt4.QtGui import QWidget, QColor, QCursor, QBrush, QApplication, QTextCursor, \ - QDialogButtonBox +from PyQt4.QtGui import QWidget, QColor, QCursor, QBrush, QApplication, \ + QTextCursor, QDialogButtonBox from E5Gui.E5Application import e5App from E5Gui import E5MessageBox, E5FileDialog @@ -68,7 +69,8 @@ def __getVersionArg(self, version): """ - Private method to get a pysvn revision object for the given version number. + Private method to get a pysvn revision object for the given version + number. @param version revision (integer or string) @return revision object (pysvn.Revision) @@ -115,7 +117,8 @@ Public slot to start the svn diff command. @param fn filename to be diffed (string) - @param versions list of versions to be diffed (list of up to 2 integer or None) + @param versions list of versions to be diffed (list of up to 2 integer + or None) @keyparam urls list of repository URLs (list of 2 strings) @keyparam summary flag indicating a summarizing diff (only valid for URL diffs) (boolean) @@ -197,7 +200,8 @@ if dname: dname += "/" for name in fnames: - self.__showError(self.trUtf8("Processing file '{0}'...\n").format(name)) + self.__showError( + self.trUtf8("Processing file '{0}'...\n").format(name)) if urls is not None: url1 = "{0}/{1}{2}".format(urls[0], dname, name) url2 = "{0}/{1}{2}".format(urls[1], dname, name) @@ -209,7 +213,8 @@ diff_list = [] for diff_sum in diff_summary: diff_list.append("{0} {1}".format( - self.__getDiffSummaryKind(diff_sum['summarize_kind']), + self.__getDiffSummaryKind( + diff_sum['summarize_kind']), diff_sum['path'])) diffText = os.linesep.join(diff_list) else: @@ -219,9 +224,11 @@ recurse=recurse) else: if pegRev is not None: - diffText = self.client.diff_peg(tmpdir, name, + diffText = self.client.diff_peg( + tmpdir, name, peg_revision=self.__getVersionArg(pegRev), - revision_start=rev1, revision_end=rev2, recurse=recurse) + revision_start=rev1, revision_end=rev2, + recurse=recurse) else: diffText = self.client.diff(tmpdir, name, revision1=rev1, revision2=rev2, recurse=recurse) @@ -259,9 +266,11 @@ @param line line of text to insert (string) """ - if line.startswith('+') or line.startswith('>') or line.startswith('A '): + if line.startswith('+') or line.startswith('>') or \ + line.startswith('A '): format = self.cAddedFormat - elif line.startswith('-') or line.startswith('<') or line.startswith('D '): + elif line.startswith('-') or line.startswith('<') or \ + line.startswith('D '): format = self.cRemovedFormat elif line.startswith('@@'): format = self.cLineNoFormat @@ -297,7 +306,8 @@ self.__oldFile = self.__extractFileName(line) else: self.__fileSeparators.append( - (self.__oldFile, self.__extractFileName(line), self.__oldFileLine)) + (self.__oldFile, self.__extractFileName(line), + self.__oldFileLine)) def __finish(self): """ @@ -318,7 +328,8 @@ self.filesCombo.addItem(self.trUtf8("<End>"), -1) for oldFile, newFile, pos in sorted(self.__fileSeparators): if oldFile != newFile: - self.filesCombo.addItem("{0}\n{1}".format(oldFile, newFile), pos) + self.filesCombo.addItem( + "{0}\n{1}".format(oldFile, newFile), pos) else: self.filesCombo.addItem(oldFile, pos) @@ -366,7 +377,8 @@ # step 2: move cursor to desired line tc = self.contents.textCursor() delta = tc.blockNumber() - para - tc.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, delta) + tc.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, + delta) self.contents.setTextCursor(tc) self.contents.ensureCursorVisible()
--- a/Plugins/VcsPlugins/vcsPySvn/SvnInfoDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnInfoDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to show repository related information for a file/directory. +Module implementing a dialog to show repository related information for a +file/directory. """ import os @@ -63,8 +64,8 @@ infoStr = "<table>" for path, info in entries: infoStr += self.trUtf8( - "<tr><td><b>Path (relative to project):</b></td><td>{0}</td></tr>")\ - .format(path) + "<tr><td><b>Path (relative to project):</b></td>" + "<td>{0}</td></tr>").format(path) if info['URL']: infoStr += self.trUtf8( "<tr><td><b>Url:</b></td><td>{0}</td></tr>")\ @@ -75,24 +76,28 @@ .format(info['rev'].number) if info['repos_root_URL']: infoStr += self.trUtf8( - "<tr><td><b>Repository root URL:</b></td><td>{0}</td></tr>")\ - .format(info['repos_root_URL']) + "<tr><td><b>Repository root URL:</b></td>" + "<td>{0}</td></tr>").format(info['repos_root_URL']) if info['repos_UUID']: infoStr += self.trUtf8( - "<tr><td><b>Repository UUID:</b></td><td>{0}</td></tr>")\ - .format(info['repos_UUID']) + "<tr><td><b>Repository UUID:</b></td>" + "<td>{0}</td></tr>").format(info['repos_UUID']) if info['last_changed_author']: infoStr += self.trUtf8( - "<tr><td><b>Last changed author:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Last changed author:</b></td>" + "<td>{0}</td></tr>")\ .format(info['last_changed_author']) if info['last_changed_date']: infoStr += self.trUtf8( - "<tr><td><b>Last Changed Date:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Last Changed Date:</b></td>" + "<td>{0}</td></tr>")\ .format(formatTime(info['last_changed_date'])) if info['last_changed_rev'] and \ - info['last_changed_rev'].kind == pysvn.opt_revision_kind.number: + info['last_changed_rev'].kind == \ + pysvn.opt_revision_kind.number: infoStr += self.trUtf8( - "<tr><td><b>Last changed revision:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Last changed revision:</b></td>" + "<td>{0}</td></tr>")\ .format(info['last_changed_rev'].number) if info['kind']: if info['kind'] == pysvn.node_kind.file: @@ -112,12 +117,14 @@ "<tr><td><b>Lock Owner:</b></td><td>{0}</td></tr>")\ .format(lockInfo['owner']) infoStr += self.trUtf8( - "<tr><td><b>Lock Creation Date:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Lock Creation Date:</b></td>" + "<td>{0}</td></tr>")\ .format(formatTime(lockInfo['creation_date'])) if lockInfo['expiration_date'] is not None: infoStr += \ self.trUtf8( - "<tr><td><b>Lock Expiration Date:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Lock Expiration Date:</b></td>" + "<td>{0}</td></tr>")\ .format(formatTime(lockInfo['expiration_date'])) infoStr += self.trUtf8( "<tr><td><b>Lock Token:</b></td><td>{0}</td></tr>")\ @@ -141,18 +148,22 @@ .format(schedule) if wcInfo['copyfrom_url']: infoStr += self.trUtf8( - "<tr><td><b>Copied From URL:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Copied From URL:</b></td>" + "<td>{0}</td></tr>")\ .format(wcInfo['copyfrom_url']) infoStr += self.trUtf8( - "<tr><td><b>Copied From Rev:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Copied From Rev:</b></td>" + "<td>{0}</td></tr>")\ .format(wcInfo['copyfrom_rev'].number) if wcInfo['text_time']: infoStr += self.trUtf8( - "<tr><td><b>Text Last Updated:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Text Last Updated:</b></td>" + "<td>{0}</td></tr>")\ .format(formatTime(wcInfo['text_time'])) if wcInfo['prop_time']: infoStr += self.trUtf8( - "<tr><td><b>Properties Last Updated:</b></td><td>{0}</td></tr>")\ + "<tr><td><b>Properties Last Updated:</b></td>" + "<td>{0}</td></tr>")\ .format(formatTime(wcInfo['prop_time'])) if wcInfo['checksum']: infoStr += self.trUtf8(
--- a/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -12,8 +12,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, QDate, QRegExp, Qt, pyqtSlot -from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, QDialogButtonBox, \ - QTreeWidgetItem +from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, \ + QDialogButtonBox, QTreeWidgetItem from E5Gui import E5MessageBox @@ -58,9 +58,12 @@ self.toDate.setDisplayFormat("yyyy-MM-dd") self.fromDate.setDate(QDate.currentDate()) self.toDate.setDate(QDate.currentDate()) - self.fieldCombo.setCurrentIndex(self.fieldCombo.findText(self.trUtf8("Message"))) - self.limitSpinBox.setValue(self.vcs.getPlugin().getPreferences("LogLimit")) - self.stopCheckBox.setChecked(self.vcs.getPlugin().getPreferences("StopLogOnCopy")) + self.fieldCombo.setCurrentIndex( + self.fieldCombo.findText(self.trUtf8("Message"))) + self.limitSpinBox.setValue( + self.vcs.getPlugin().getPreferences("LogLimit")) + self.stopCheckBox.setChecked( + self.vcs.getPlugin().getPreferences("StopLogOnCopy")) self.__messageRole = Qt.UserRole self.__changesRole = Qt.UserRole + 1 @@ -165,7 +168,8 @@ if changedPath["copyfrom_revision"] is None: copyRev = "" else: - copyRev = "{0:7d}".format(changedPath["copyfrom_revision"].number) + copyRev = "{0:7d}".format( + changedPath["copyfrom_revision"].number) change = { "action": changedPath["action"], "path": changedPath["path"], @@ -219,7 +223,8 @@ start = pysvn.Revision(pysvn.opt_revision_kind.head) else: try: - start = pysvn.Revision(pysvn.opt_revision_kind.number, int(startRev)) + start = pysvn.Revision(pysvn.opt_revision_kind.number, + int(startRev)) except TypeError: start = pysvn.Revision(pysvn.opt_revision_kind.head) @@ -255,7 +260,8 @@ self.__generateLogItem(log["author"], log["date"], log["message"], log["revision"], log['changed_paths']) dt = dateFromTime_t(log["date"]) - if not self.__maxDate.isValid() and not self.__minDate.isValid(): + if not self.__maxDate.isValid() and \ + not self.__minDate.isValid(): self.__maxDate = dt self.__minDate = dt else: @@ -321,7 +327,8 @@ @param peg_rev revision number to use as a reference (integer) """ if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): - self.vcs.svnSbsDiff(self.filename, revisions=(str(rev1), str(rev2))) + self.vcs.svnSbsDiff(self.filename, + revisions=(str(rev1), str(rev2))) else: if self.diff is None: from .SvnDiffDialog import SvnDiffDialog @@ -363,14 +370,16 @@ self.__resortFiles() self.diffPreviousButton.setEnabled( - current != self.logTree.topLevelItem(self.logTree.topLevelItemCount() - 1)) + current != self.logTree.topLevelItem( + self.logTree.topLevelItemCount() - 1)) @pyqtSlot() def on_logTree_itemSelectionChanged(self): """ Private slot called, when the selection has changed. """ - self.diffRevisionsButton.setEnabled(len(self.logTree.selectedItems()) == 2) + self.diffRevisionsButton.setEnabled( + len(self.logTree.selectedItems()) == 2) @pyqtSlot() def on_nextButton_clicked(self): @@ -397,7 +406,8 @@ return rev2 = int(itm.text(0)) - itm = self.logTree.topLevelItem(self.logTree.indexOfTopLevelItem(itm) + 1) + itm = self.logTree.topLevelItem( + self.logTree.indexOfTopLevelItem(itm) + 1) if itm is None: self.diffPreviousButton.setEnabled(False) return @@ -487,7 +497,8 @@ fieldIndex = 0 txt = self.rxEdit.text() if txt.startswith("^"): - searchRx = QRegExp("^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) + searchRx = QRegExp( + "^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) else: searchRx = QRegExp(txt, Qt.CaseInsensitive) else:
--- a/Plugins/VcsPlugins/vcsPySvn/SvnLogDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnLogDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -12,7 +12,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, QByteArray, QUrl, Qt -from PyQt4.QtGui import QWidget, QCursor, QApplication, QTextCursor, QDialogButtonBox +from PyQt4.QtGui import QWidget, QCursor, QApplication, QTextCursor, \ + QDialogButtonBox from .SvnUtilities import formatTime @@ -131,7 +132,8 @@ if self.__pegRev is None: self.__pegRev = int(ver) try: - lv = "{0:d}".format(logs[logs.index(log) + 1]["revision"].number) + lv = "{0:d}".format( + logs[logs.index(log) + 1]["revision"].number) url = QUrl() url.setScheme("file") url.setPath(self.filename) @@ -139,14 +141,16 @@ query.append(lv).append('_').append(ver) url.setEncodedQuery(query) dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format( - url.toString(), query, self.trUtf8('diff to {0}').format(lv) + url.toString(), query, + self.trUtf8('diff to {0}').format(lv) ) except IndexError: pass dstr += '<br />\n' self.contents.insertHtml(dstr) - dstr = self.trUtf8('<i>author: {0}</i><br />\n').format(log["author"]) + dstr = self.trUtf8('<i>author: {0}</i><br />\n')\ + .format(log["author"]) self.contents.insertHtml(dstr) dstr = self.trUtf8('<i>date: {0}</i><br />\n')\ @@ -166,9 +170,10 @@ .format(self.flags[changeInfo["action"]], changeInfo["path"]) if changeInfo["copyfrom_path"] is not None: - dstr += self.trUtf8(" (copied from {0}, revision {1})")\ - .format(changeInfo["copyfrom_path"], - changeInfo["copyfrom_revision"].number) + dstr += self.trUtf8( + " (copied from {0}, revision {1})")\ + .format(changeInfo["copyfrom_path"], + changeInfo["copyfrom_revision"].number) dstr += '<br />\n' self.contents.insertHtml(dstr)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnMergeDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnMergeDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -17,12 +17,15 @@ """ Class implementing a dialog to enter the data for a merge operation. """ - def __init__(self, mergelist1, mergelist2, targetlist, force=False, parent=None): + def __init__(self, mergelist1, mergelist2, targetlist, force=False, + parent=None): """ Constructor - @param mergelist1 list of previously entered URLs/revisions (list of strings) - @param mergelist2 list of previously entered URLs/revisions (list of strings) + @param mergelist1 list of previously entered URLs/revisions + (list of strings) + @param mergelist2 list of previously entered URLs/revisions + (list of strings) @param targetlist list of previously entered targets (list of strings) @param force flag indicating a forced merge (boolean) @param parent parent widget (QWidget)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing the Subversion Options Dialog for a new project from the repository. +Module implementing the Subversion Options Dialog for a new project from the +repository. """ import os @@ -24,7 +25,8 @@ class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog): """ - Class implementing the Options Dialog for a new project from the repository. + Class implementing the Options Dialog for a new project from the + repository. """ def __init__(self, vcs, parent=None): """ @@ -52,7 +54,8 @@ self.localProtocol = True self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators( - Preferences.getMultiProject("Workspace") or Utilities.getHomeDir())) + Preferences.getMultiProject("Workspace") or + Utilities.getHomeDir())) @pyqtSlot() def on_vcsUrlButton_clicked(self): @@ -67,11 +70,13 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsUrlEdit.setText( + Utilities.toNativeSeparators(directory)) else: from .SvnRepoBrowserDialog import SvnRepoBrowserDialog dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) - dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) + dlg.start( + self.protocolCombo.currentText() + self.vcsUrlEdit.text()) if dlg.exec_() == QDialog.Accepted: url = dlg.getSelectedUrl() if url: @@ -93,7 +98,8 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsProjectDirEdit.setText( + Utilities.toNativeSeparators(directory)) def on_layoutCheckBox_toggled(self, checked): """
--- a/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to enter options used to start a project in the VCS. +Module implementing a dialog to enter options used to start a project in the +VCS. """ import os @@ -66,11 +67,13 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsUrlEdit.setText( + Utilities.toNativeSeparators(directory)) else: from .SvnRepoBrowserDialog import SvnRepoBrowserDialog dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) - dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) + dlg.start( + self.protocolCombo.currentText() + self.vcsUrlEdit.text()) if dlg.exec_() == QDialog.Accepted: url = dlg.getSelectedUrl() if url:
--- a/Plugins/VcsPlugins/vcsPySvn/SvnPropListDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnPropListDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to show the output of the svn proplist command process. +Module implementing a dialog to show the output of the svn proplist command +process. """ import os @@ -21,7 +22,8 @@ class SvnPropListDialog(QWidget, SvnDialogMixin, Ui_SvnPropListDialog): """ - Class implementing a dialog to show the output of the svn proplist command process. + Class implementing a dialog to show the output of the svn proplist command + process. """ def __init__(self, vcs, parent=None): """ @@ -118,7 +120,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if not self.propsFound: self.__generateItem("", self.trUtf8("None"), "")
--- a/Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -10,8 +10,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, Qt, pyqtSlot -from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, QDialogButtonBox, \ - QTreeWidgetItem +from PyQt4.QtGui import QCursor, QHeaderView, QDialog, QApplication, \ + QDialogButtonBox, QTreeWidgetItem from E5Gui import E5MessageBox @@ -88,7 +88,8 @@ """ Private method to generate a tree item in the repository tree. - @param parent parent of the item to be created (QTreeWidget or QTreeWidgetItem) + @param parent parent of the item to be created (QTreeWidget or + QTreeWidgetItem) @param repopath path of the item (string) @param revision revision info (string or pysvn.opt_revision_kind) @param author author info (string) @@ -163,7 +164,8 @@ continue if firstTime: if dirent["repos_path"] != "/": - repoUrl = dirent["path"].replace(dirent["repos_path"], "") + repoUrl = dirent["path"].replace( + dirent["repos_path"], "") else: repoUrl = dirent["path"] if repoUrl != url: @@ -173,9 +175,11 @@ itm.setExpanded(True) parent = itm urlPart = repoUrl - for element in dirent["repos_path"].split("/")[:-1]: + for element in \ + dirent["repos_path"].split("/")[:-1]: if element: - urlPart = "{0}/{1}".format(urlPart, element) + urlPart = "{0}/{1}".format(urlPart, + element) itm = self.__generateItem(parent, element, "", "", 0, "", pysvn.node_kind.dir, urlPart)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnRevisionSelectionDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnRevisionSelectionDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -15,7 +15,8 @@ class SvnRevisionSelectionDialog(QDialog, Ui_SvnRevisionSelectionDialog): """ - Class implementing a dialog to enter the revisions for the svn diff command. + Class implementing a dialog to enter the revisions for the svn diff + command. """ def __init__(self, parent=None): """ @@ -63,7 +64,8 @@ return numberSpinBox.value() elif dateButton.isChecked(): return "{{{0}}}".format( - QDateTime(dateEdit.date(), timeEdit.time()).toString(Qt.ISODate)) + QDateTime(dateEdit.date(), timeEdit.time()) + .toString(Qt.ISODate)) elif headButton.isChecked(): return "HEAD" elif workingButton.isChecked():
--- a/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -328,10 +328,12 @@ uptodate = True if file.repos_text_status != pysvn.wc_status_kind.none: uptodate = uptodate and \ - file.repos_text_status != pysvn.wc_status_kind.modified + file.repos_text_status != \ + pysvn.wc_status_kind.modified if file.repos_prop_status != pysvn.wc_status_kind.none: uptodate = uptodate and \ - file.repos_prop_status != pysvn.wc_status_kind.modified + file.repos_prop_status != \ + pysvn.wc_status_kind.modified lockState = " " if file.entry is not None and \ @@ -348,7 +350,8 @@ file.entry.lock_token != file.repos_lock["token"]: lockState = "S" - fpath = Utilities.normcasepath(os.path.join(self.dname, file.path)) + fpath = Utilities.normcasepath( + os.path.join(self.dname, file.path)) if fpath in changelistsDict: changelist = changelistsDict[fpath] else:
--- a/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py Sat Oct 12 17:31:40 2013 +0200 @@ -64,11 +64,9 @@ cwd = os.getcwd() os.chdir(self.projectDir) try: - allFiles = client.status('.', - recurse=True, - get_all=True, - ignore=True, - update=not Preferences.getVCS("MonitorLocalStatus")) + allFiles = client.status( + '.', recurse=True, get_all=True, ignore=True, + update=not Preferences.getVCS("MonitorLocalStatus")) states = {} for file in allFiles: uptodate = True @@ -102,16 +100,18 @@ states[file.path] = status try: if self.reportedStates[file.path] != status: - self.statusList.append("{0} {1}".format(status, file.path)) + self.statusList.append( + "{0} {1}".format(status, file.path)) except KeyError: - self.statusList.append("{0} {1}".format(status, file.path)) + self.statusList.append( + "{0} {1}".format(status, file.path)) for name in list(self.reportedStates.keys()): if name not in states: self.statusList.append(" {0}".format(name)) self.reportedStates = states res = True - statusStr = \ - self.trUtf8("Subversion status checked successfully (using pysvn)") + statusStr = self.trUtf8( + "Subversion status checked successfully (using pysvn)") except pysvn.ClientError as e: res = False statusStr = e.args[0]
--- a/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -12,8 +12,8 @@ import pysvn from PyQt4.QtCore import QMutexLocker, QRegExp, Qt -from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QInputDialog, QApplication, \ - QDialogButtonBox, QTreeWidgetItem +from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QInputDialog, \ + QApplication, QDialogButtonBox, QTreeWidgetItem from E5Gui import E5MessageBox @@ -23,7 +23,8 @@ from .Ui_SvnTagBranchListDialog import Ui_SvnTagBranchListDialog -class SvnTagBranchListDialog(QDialog, SvnDialogMixin, Ui_SvnTagBranchListDialog): +class SvnTagBranchListDialog(QDialog, SvnDialogMixin, + Ui_SvnTagBranchListDialog): """ Class implementing a dialog to show a list of tags or branches. """ @@ -76,9 +77,10 @@ if reposURL is None: E5MessageBox.critical(self, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The list operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The list operation""" + """ will be aborted""")) self.close() return False @@ -103,7 +105,8 @@ reposPath, ok = QInputDialog.getText( self, self.trUtf8("Subversion List"), - self.trUtf8("Enter the repository URL containing the tags or branches"), + self.trUtf8("Enter the repository URL containing the" + " tags or branches"), QLineEdit.Normal, self.vcs.svnNormalizeURL(reposURL)) if not ok: @@ -112,7 +115,8 @@ if not reposPath: E5MessageBox.critical(self, self.trUtf8("Subversion List"), - self.trUtf8("""The repository URL is empty. Aborting...""")) + self.trUtf8( + """The repository URL is empty. Aborting...""")) self.close() return False path = reposPath @@ -142,7 +146,8 @@ res = False except AttributeError: self.__showError( - self.trUtf8("The installed version of PySvn should be 1.4.0 or better.")) + self.trUtf8("The installed version of PySvn should be" + " 1.4.0 or better.")) res = False locker.unlock() self.__finish() @@ -151,7 +156,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnUrlSelectionDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/SvnUrlSelectionDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -52,7 +52,8 @@ if reposURL is None: E5MessageBox.critical(self, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" + self.trUtf8( + """The URL of the project repository could not be""" """ retrieved from the working copy. The operation will""" """ be aborted""")) self.reject()
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py Sat Oct 12 17:31:40 2013 +0200 @@ -83,7 +83,8 @@ self.commandHistory = [] self.wdHistory = [] - if pysvn.version >= (1, 4, 3, 0) and "SVN_ASP_DOT_NET_HACK" in os.environ: + if pysvn.version >= (1, 4, 3, 0) and \ + "SVN_ASP_DOT_NET_HACK" in os.environ: self.adminDir = '_svn' else: self.adminDir = '.svn' @@ -103,7 +104,8 @@ self.__commitData = {} self.__commitDialog = None - self.__wcng = True # assume new generation working copy metadata format + self.__wcng = True # assume new generation working copy + # metadata format def getPlugin(self): """ @@ -133,9 +135,9 @@ return client - ############################################################################ + ########################################################################### ## Methods of the VCS interface - ############################################################################ + ########################################################################### def vcsShutdown(self): """ @@ -164,7 +166,8 @@ """ Public method used to test for the presence of the svn executable. - @return flag indicating the existance (boolean) and an error message (string) + @return flag indicating the existance (boolean) and an error message + (string) """ self.versionStr = ".".join([str(v) for v in pysvn.svn_version[:-1]]) self.version = pysvn.svn_version[:-1] @@ -186,7 +189,8 @@ def vcsConvertProject(self, vcsDataDict, project): """ - Public method to convert an uncontrolled project to a version controlled project. + Public method to convert an uncontrolled project to a version + controlled project. @param vcsDataDict dictionary of data required for the conversion @param project reference to the project object @@ -195,9 +199,10 @@ if not success: E5MessageBox.critical(self.__ui, self.trUtf8("Create project in repository"), - self.trUtf8("""The project could not be created in the repository.""" - """ Maybe the given repository doesn't exist or the""" - """ repository server is down.""")) + self.trUtf8( + """The project could not be created in the repository.""" + """ Maybe the given repository doesn't exist or the""" + """ repository server is down.""")) else: cwdIsPpath = False if os.getcwd() == project.ppath: @@ -217,9 +222,10 @@ if not os.path.isfile(pfn): E5MessageBox.critical(self.__ui, self.trUtf8("New project"), - self.trUtf8("""The project could not be checked out of the""" - """ repository.<br />""" - """Restoring the original contents.""")) + self.trUtf8( + """The project could not be checked out of the""" + """ repository.<br />""" + """Restoring the original contents.""")) if os.getcwd() == project.ppath: os.chdir(os.path.dirname(project.ppath)) cwdIsPpath = True @@ -239,7 +245,8 @@ def vcsImport(self, vcsDataDict, projectDir, noDialog=False): """ - Public method used to import the project into the Subversion repository. + Public method used to import the project into the Subversion + repository. @param vcsDataDict dictionary of data required for the import @param projectDir project directory (string) @@ -268,7 +275,8 @@ os.mkdir(os.path.join(tmpDir, project)) os.mkdir(os.path.join(tmpDir, project, 'branches')) os.mkdir(os.path.join(tmpDir, project, 'tags')) - shutil.copytree(projectDir, os.path.join(tmpDir, project, 'trunk')) + shutil.copytree( + projectDir, os.path.join(tmpDir, project, 'trunk')) else: shutil.copytree(projectDir, os.path.join(tmpDir, project)) except OSError as e: @@ -284,12 +292,11 @@ url = self.__svnURL(vcsDir) client = self.getClient() if not noDialog: - dlg = \ - SvnDialog(self.trUtf8('Importing project into Subversion repository'), - "import{0} --message {1} .".format( - (not recurse) and " --non-recursive" or "", - msg), - client) + dlg = SvnDialog( + self.trUtf8('Importing project into Subversion repository'), + "import{0} --message {1} .".format( + (not recurse) and " --non-recursive" or "", msg), + client) QApplication.processEvents() try: rev = client.import_(".", url, msg, recurse, ignore=True) @@ -312,7 +319,8 @@ def vcsCheckout(self, vcsDataDict, projectDir, noDialog=False): """ - Public method used to check the project out of the Subversion repository. + Public method used to check the project out of the Subversion + repository. @param vcsDataDict dictionary of data required for the checkout @param projectDir project directory to create (string) @@ -334,7 +342,8 @@ if tag is None or tag == '': svnUrl = '{0}/trunk'.format(vcsDir) else: - if not tag.startswith('tags') and not tag.startswith('branches'): + if not tag.startswith('tags') and \ + not tag.startswith('branches'): type_, ok = QInputDialog.getItem( None, self.trUtf8("Subversion Checkout"), @@ -355,12 +364,12 @@ url = self.__svnURL(svnUrl) client = self.getClient() if not noDialog: - dlg = \ - SvnDialog(self.trUtf8('Checking project out of Subversion repository'), - "checkout{0} {1} {2}".format( - (not recurse) and " --non-recursive" or "", - url, projectDir), - client) + dlg = SvnDialog( + self.trUtf8('Checking project out of Subversion repository'), + "checkout{0} {1} {2}".format( + (not recurse) and " --non-recursive" or "", + url, projectDir), + client) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -378,7 +387,8 @@ def vcsExport(self, vcsDataDict, projectDir): """ - Public method used to export a directory from the Subversion repository. + Public method used to export a directory from the Subversion + repository. @param vcsDataDict dictionary of data required for the checkout @param projectDir project directory to create (string) @@ -396,7 +406,8 @@ if tag is None or tag == '': svnUrl = '{0}/trunk'.format(vcsDir) else: - if not tag.startswith('tags') and not tag.startswith('branches'): + if not tag.startswith('tags') and \ + not tag.startswith('branches'): type_, ok = QInputDialog.getItem( None, self.trUtf8("Subversion Export"), @@ -416,12 +427,12 @@ recurse = "--non-recursive" not in opts url = self.__svnURL(svnUrl) client = self.getClient() - dlg = \ - SvnDialog(self.trUtf8('Exporting project from Subversion repository'), - "export --force{0} {1} {2}".format( - (not recurse) and " --non-recursive" or "", - url, projectDir), - client) + dlg = SvnDialog( + self.trUtf8('Exporting project from Subversion repository'), + "export --force{0} {1} {2}".format( + (not recurse) and " --non-recursive" or "", + url, projectDir), + client) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -437,10 +448,11 @@ def vcsCommit(self, name, message, noDialog=False): """ - Public method used to make the change of a file/directory permanent in the - Subversion repository. + Public method used to make the change of a file/directory permanent + in the Subversion repository. - @param name file/directory name to be committed (string or list of strings) + @param name file/directory name to be committed (string or + list of strings) @param message message for this operation (string) @param noDialog flag indicating quiet operations """ @@ -448,7 +460,8 @@ # call CommitDialog and get message from there if self.__commitDialog is None: from .SvnCommitDialog import SvnCommitDialog - self.__commitDialog = SvnCommitDialog(self.svnGetChangelists(), self.__ui) + self.__commitDialog = SvnCommitDialog( + self.svnGetChangelists(), self.__ui) self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) self.__commitDialog.show() self.__commitDialog.raise_() @@ -481,11 +494,13 @@ if os.path.isdir(nam): project = e5App().getObject("Project") if nam == project.getProjectPath(): - ok &= project.checkAllScriptsDirty(reportSyntaxErrors=True) and \ + ok &= project.checkAllScriptsDirty( + reportSyntaxErrors=True) and \ project.checkDirty() continue elif os.path.isfile(nam): - editor = e5App().getObject("ViewManager").getOpenEditor(nam) + editor = e5App().getObject("ViewManager")\ + .getOpenEditor(nam) if editor: ok &= editor.checkDirty() if not ok: @@ -494,8 +509,9 @@ if not ok: res = E5MessageBox.yesNo(self.__ui, self.trUtf8("Commit Changes"), - self.trUtf8("""The commit affects files, that have unsaved""" - """ changes. Shall the commit be continued?"""), + self.trUtf8( + """The commit affects files, that have unsaved""" + """ changes. Shall the commit be continued?"""), icon=E5MessageBox.Warning) if not res: return @@ -503,10 +519,10 @@ if self.__commitDialog is not None: msg = self.__commitDialog.logMessage() if self.__commitDialog.hasChangelists(): - changelists, keepChangelists = self.__commitDialog.changelistsData() + changelists, keepChangelists = \ + self.__commitDialog.changelistsData() else: changelists, keepChangelists = [], False -## self.__commitDialog.accepted.disconnect(self.__vcsCommit_Step2) self.__commitDialog.deleteLater() self.__commitDialog = None else: @@ -533,16 +549,16 @@ keeplocks = "--keep-locks" in opts client = self.getClient() if not noDialog: - dlg = \ - SvnDialog(self.trUtf8('Commiting changes to Subversion repository'), - "commit{0}{1}{2}{3} --message {4} {5}".format( - (not recurse) and " --non-recursive" or "", - keeplocks and " --keep-locks" or "", - keepChangelists and " --keep-changelists" or "", - changelists and \ - " --changelist ".join([""] + changelists) or "", - msg, " ".join(fnames)), - client) + dlg = SvnDialog( + self.trUtf8('Commiting changes to Subversion repository'), + "commit{0}{1}{2}{3} --message {4} {5}".format( + (not recurse) and " --non-recursive" or "", + keeplocks and " --keep-locks" or "", + keepChangelists and " --keep-changelists" or "", + changelists and \ + " --changelist ".join([""] + changelists) or "", + msg, " ".join(fnames)), + client) QApplication.processEvents() try: if changelists: @@ -569,9 +585,11 @@ def vcsUpdate(self, name, noDialog=False): """ - Public method used to update a file/directory with the Subversion repository. + Public method used to update a file/directory with the Subversion + repository. - @param name file/directory name to be updated (string or list of strings) + @param name file/directory name to be updated (string or list of + strings) @param noDialog flag indicating quiet operations (boolean) @return flag indicating, that the update contained an add or delete (boolean) @@ -589,12 +607,12 @@ recurse = "--non-recursive" not in opts client = self.getClient() if not noDialog: - dlg = \ - SvnDialog(self.trUtf8('Synchronizing with the Subversion repository'), - "update{0} {1}".format( - (not recurse) and " --non-recursive" or "", - " ".join(fnames)), - client) + dlg = SvnDialog( + self.trUtf8('Synchronizing with the Subversion repository'), + "update{0} {1}".format( + (not recurse) and " --non-recursive" or "", + " ".join(fnames)), + client) QApplication.processEvents() try: client.update(fnames, recurse) @@ -613,7 +631,8 @@ def vcsAdd(self, name, isDir=False, noDialog=False): """ - Public method used to add a file/directory to the Subversion repository. + Public method used to add a file/directory to the Subversion + repository. @param name file/directory name to be added (string) @param isDir flag indicating name is a directory (boolean) @@ -640,14 +659,17 @@ return # oops, project is not version controlled while os.path.normcase(dname) != os.path.normcase(repodir) and \ (os.path.normcase(dname) not in self.statusCache or \ - self.statusCache[os.path.normcase(dname)] == self.canBeAdded): - # add directories recursively, if they aren't in the repository already + self.statusCache[os.path.normcase(dname)] == + self.canBeAdded): + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) wdir = dname else: while not os.path.exists(os.path.join(dname, self.adminDir)): - # add directories recursively, if they aren't in the repository already + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) wdir = dname @@ -659,14 +681,17 @@ d = os.path.dirname(n) if self.__wcng: repodir = d - while not os.path.isdir(os.path.join(repodir, self.adminDir)): + while not os.path.isdir( + os.path.join(repodir, self.adminDir)): repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != os.path.normcase(repodir) and \ + while os.path.normcase(d) != \ + os.path.normcase(repodir) and \ (d not in tree2 + tree) and \ (os.path.normcase(d) not in self.statusCache or \ - self.statusCache[os.path.normcase(d)] == self.canBeAdded): + self.statusCache[os.path.normcase(d)] == + self.canBeAdded): tree2.append(d) d = os.path.dirname(d) else: @@ -690,17 +715,18 @@ noignore = "--no-ignore" in opts client = self.getClient() if not noDialog: - dlg = \ - SvnDialog( - self.trUtf8('Adding files/directories to the Subversion repository'), - "add --non-recursive{0}{1} {2}".format( - force and " --force" or "", - noignore and " --no-ignore" or "", - " ".join(names)), - client) + dlg = SvnDialog( + self.trUtf8('Adding files/directories to the Subversion' + ' repository'), + "add --non-recursive{0}{1} {2}".format( + force and " --force" or "", + noignore and " --no-ignore" or "", + " ".join(names)), + client) QApplication.processEvents() try: - client.add(names, recurse=recurse, force=force, ignore=not noignore) + client.add(names, recurse=recurse, force=force, + ignore=not noignore) except pysvn.ClientError as e: if not noDialog: dlg.showError(e.args[0]) @@ -722,9 +748,11 @@ def vcsAddTree(self, path): """ - Public method to add a directory tree rooted at path to the Subversion repository. + Public method to add a directory tree rooted at path to the Subversion + repository. - @param path root directory of the tree to be added (string or list of strings)) + @param path root directory of the tree to be added (string or list of + strings)) """ tree = [] if isinstance(path, list): @@ -733,14 +761,17 @@ d = os.path.dirname(n) if self.__wcng: repodir = d - while not os.path.isdir(os.path.join(repodir, self.adminDir)): + while not os.path.isdir( + os.path.join(repodir, self.adminDir)): repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != os.path.normcase(repodir) and \ + while os.path.normcase(d) != \ + os.path.normcase(repodir) and \ (d not in tree) and \ (os.path.normcase(d) not in self.statusCache or \ - self.statusCache[os.path.normcase(d)] == self.canBeAdded): + self.statusCache[os.path.normcase(d)] == + self.canBeAdded): tree.append(d) d = os.path.dirname(d) else: @@ -760,10 +791,13 @@ repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(dname) != os.path.normcase(repodir) and \ + while os.path.normcase(dname) != \ + os.path.normcase(repodir) and \ (os.path.normcase(dname) not in self.statusCache or \ - self.statusCache[os.path.normcase(dname)] == self.canBeAdded): - # add directories recursively, if they aren't in the repository already + self.statusCache[os.path.normcase(dname)] == + self.canBeAdded): + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) else: @@ -789,14 +823,13 @@ force = "--force" in opts ignore = "--ignore" in opts client = self.getClient() - dlg = \ - SvnDialog( - self.trUtf8('Adding directory trees to the Subversion repository'), - "add{0}{1} {2}".format( - force and " --force" or "", - ignore and " --ignore" or "", - " ".join(names)), - client) + dlg = SvnDialog( + self.trUtf8('Adding directory trees to the Subversion repository'), + "add{0}{1} {2}".format( + force and " --force" or "", + ignore and " --ignore" or "", + " ".join(names)), + client) QApplication.processEvents() try: client.add(names, recurse=recurse, force=force, ignore=ignore) @@ -809,12 +842,15 @@ def vcsRemove(self, name, project=False, noDialog=False): """ - Public method used to remove a file/directory from the Subversion repository. + Public method used to remove a file/directory from the Subversion + repository. The default operation is to remove the local copy as well. - @param name file/directory name to be removed (string or list of strings)) - @param project flag indicating deletion of a project tree (boolean) (not needed) + @param name file/directory name to be removed (string or list of + strings)) + @param project flag indicating deletion of a project tree (boolean) + (not needed) @param noDialog flag indicating quiet operations @return flag indicating successfull operation (boolean) """ @@ -824,13 +860,13 @@ force = "--force" in opts or noDialog client = self.getClient() if not noDialog: - dlg = \ - SvnDialog( - self.trUtf8('Removing files/directories from the Subversion repository'), - "remove{0} {1}".format( - force and " --force" or "", - " ".join(name)), - client) + dlg = SvnDialog( + self.trUtf8('Removing files/directories from the Subversion' + ' repository'), + "remove{0} {1}".format( + force and " --force" or "", + " ".join(name)), + client) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -947,8 +983,9 @@ Subversion repository. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. @param name file/directory name to be diffed (string) """ @@ -998,9 +1035,10 @@ if reposURL is None: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The tag operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The tag operation""" + """ will be aborted""")) return if self.otherData["standardLayout"]: @@ -1032,7 +1070,8 @@ if tagOp in [1, 4]: url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) elif tagOp in [2, 8]: - url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag)) + url = '{0}/branches/{1}'.format( + reposRoot, urllib.parse.quote(tag)) else: url = self.__svnURL(tag) @@ -1041,11 +1080,11 @@ rev = None if tagOp in [1, 2]: log = 'Created tag <{0}>'.format(self.tagName) - dlg = \ - SvnDialog( - self.trUtf8('Tagging {0} in the Subversion repository').format(name), - "copy --message {0} {1} {2}".format(log, reposURL, url), - client, log=log) + dlg = SvnDialog( + self.trUtf8('Tagging {0} in the Subversion repository') + .format(name), + "copy --message {0} {1} {2}".format(log, reposURL, url), + client, log=log) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -1055,11 +1094,11 @@ locker.unlock() else: log = 'Deleted tag <{0}>'.format(self.tagName) - dlg = \ - SvnDialog( - self.trUtf8('Tagging {0} in the Subversion repository').format(name), - "remove --message {0} {1}".format(log, url), - client, log=log) + dlg = SvnDialog( + self.trUtf8('Tagging {0} in the Subversion repository') + .format(name), + "remove --message {0} {1}".format(log, url), + client, log=log) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -1087,11 +1126,13 @@ project = e5App().getObject("Project") names = [project.getRelativePath(nam) for nam in name] if names[0]: - from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog + from UI.DeleteFilesConfirmationDialog import \ + DeleteFilesConfirmationDialog dia = DeleteFilesConfirmationDialog(self.parent(), self.trUtf8("Revert changes"), - self.trUtf8("Do you really want to revert all changes to these files" - " or directories?"), + self.trUtf8( + "Do you really want to revert all changes to these files" + " or directories?"), name) yes = dia.exec_() == QDialog.Accepted else: @@ -1101,11 +1142,12 @@ """ the project?""")) if yes: client = self.getClient() - dlg = \ - SvnDialog(self.trUtf8('Reverting changes'), - "revert {0} {1}".format((not recurse) and " --non-recursive" or "", - " ".join(name)), - client) + dlg = SvnDialog( + self.trUtf8('Reverting changes'), + "revert {0} {1}".format( + (not recurse) and " --non-recursive" or "", + " ".join(name)), + client) QApplication.processEvents() locker = QMutexLocker(self.vcsExecutionMutex) try: @@ -1131,9 +1173,10 @@ if reposURL is None: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The switch operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The switch""" + """ operation will be aborted""")) return False if self.otherData["standardLayout"]: @@ -1166,7 +1209,8 @@ if tagType == 1: url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) elif tagType == 2: - url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag)) + url = '{0}/branches/{1}'.format( + reposRoot, urllib.parse.quote(tag)) elif tagType == 4: url = '{0}/trunk'.format(reposRoot) tn = 'HEAD' @@ -1203,8 +1247,8 @@ opts = self.options['global'] from .SvnMergeDialog import SvnMergeDialog - dlg = SvnMergeDialog(self.mergeList[0], self.mergeList[1], self.mergeList[2], - "--force" in opts) + dlg = SvnMergeDialog(self.mergeList[0], self.mergeList[1], + self.mergeList[2], "--force" in opts) if dlg.exec_() == QDialog.Accepted: urlrev1, urlrev2, target, force = dlg.getParameters() else: @@ -1229,15 +1273,15 @@ revision1 = pysvn.Revision(pysvn.opt_revision_kind.head) rev1 = "HEAD" else: - revision1 = \ - pysvn.Revision(pysvn.opt_revision_kind.number, int(urlrev1)) + revision1 = pysvn.Revision( + pysvn.opt_revision_kind.number, int(urlrev1)) rev1 = urlrev1 if urlrev2 in ["HEAD", "head"]: revision2 = pysvn.Revision(pysvn.opt_revision_kind.head) rev2 = "HEAD" else: - revision2 = \ - pysvn.Revision(pysvn.opt_revision_kind.number, int(urlrev2)) + revision2 = pysvn.Revision( + pysvn.opt_revision_kind.number, int(urlrev2)) rev2 = urlrev2 if not target: url1 = name @@ -1257,8 +1301,8 @@ revision1 = pysvn.Revision(pysvn.opt_revision_kind.head) rev1 = "HEAD" else: - revision1 = \ - pysvn.Revision(pysvn.opt_revision_kind.number, int(rev)) + revision1 = pysvn.Revision( + pysvn.opt_revision_kind.number, int(rev)) rev1 = rev else: url1 = urlrev1 @@ -1270,8 +1314,8 @@ revision2 = pysvn.Revision(pysvn.opt_revision_kind.head) rev2 = "HEAD" else: - revision2 = \ - pysvn.Revision(pysvn.opt_revision_kind.number, int(rev)) + revision2 = pysvn.Revision( + pysvn.opt_revision_kind.number, int(rev)) rev2 = rev else: url2 = urlrev2 @@ -1315,8 +1359,8 @@ """ Private method used to get the registered state of a file in the vcs. - This is the variant for subversion installations using the new working copy - meta-data format. + This is the variant for subversion installations using the new + working copy meta-data format. @param name filename to check (string) @return a combination of canBeCommited and canBeAdded @@ -1344,8 +1388,8 @@ """ Private method used to get the registered state of a file in the vcs. - This is the variant for subversion installations using the old working copy - meta-data format. + This is the variant for subversion installations using the old working + copy meta-data format. @param name filename to check (string) @return a combination of canBeCommited and canBeAdded @@ -1368,11 +1412,12 @@ def vcsAllRegisteredStates(self, names, dname, shortcut=True): """ - Public method used to get the registered states of a number of files in the vcs. + Public method used to get the registered states of a number of files + in the vcs. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files has been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1387,14 +1432,15 @@ def __vcsAllRegisteredStates_wcng(self, names, dname, shortcut=True): """ - Private method used to get the registered states of a number of files in the vcs. + Private method used to get the registered states of a number of files + in the vcs. - This is the variant for subversion installations using the new working copy - meta-data format. + This is the variant for subversion installations using the new working + copy meta-data format. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files has been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1464,14 +1510,15 @@ def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True): """ - Private method used to get the registered states of a number of files in the vcs. + Private method used to get the registered states of a number of files + in the VCS. - This is the variant for subversion installations using the old working copy - meta-data format. + This is the variant for subversion installations using the old working + copy meta-data format. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files has been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1530,7 +1577,8 @@ """ Public method to initialize the VCS configuration. - This method ensures, that eric specific files and directories are ignored. + This method ensures, that eric specific files and directories are + ignored. @param project reference to the project (Project) """ @@ -1664,18 +1712,21 @@ entry.url, entry.revision.number, entry.commit_revision.number, - time.strftime("%Y-%m-%d", time.localtime(entry.commit_time)), - time.strftime("%H:%M:%S %Z", time.localtime(entry.commit_time)), + time.strftime( + "%Y-%m-%d", time.localtime(entry.commit_time)), + time.strftime( + "%H:%M:%S %Z", time.localtime(entry.commit_time)), entry.commit_author ) - ############################################################################ + ########################################################################### ## Public Subversion specific methods are below. - ############################################################################ + ########################################################################### def svnGetReposName(self, path): """ - Public method used to retrieve the URL of the subversion repository path. + Public method used to retrieve the URL of the subversion repository + path. @param path local path to get the svn repository path for (string) @return string with the repository path URL @@ -1802,7 +1853,8 @@ if not propName: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Set Property"), - self.trUtf8("""You have to supply a property name. Aborting.""")) + self.trUtf8( + """You have to supply a property name. Aborting.""")) return if isinstance(name, list): @@ -1854,7 +1906,8 @@ if not propName: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Delete Property"), - self.trUtf8("""You have to supply a property name. Aborting.""")) + self.trUtf8( + """You have to supply a property name. Aborting.""")) return if isinstance(name, list): @@ -1907,12 +1960,14 @@ if tags: self.tagsList = self.tagbranchList.getTagList() if not self.showedTags: - self.allTagsBranchesList = self.allTagsBranchesList + self.tagsList + self.allTagsBranchesList = \ + self.allTagsBranchesList + self.tagsList self.showedTags = True elif not tags: self.branchesList = self.tagbranchList.getTagList() if not self.showedBranches: - self.allTagsBranchesList = self.allTagsBranchesList + self.branchesList + self.allTagsBranchesList = \ + self.allTagsBranchesList + self.branchesList self.showedBranches = True def svnBlame(self, name): @@ -1933,8 +1988,9 @@ Subversion repository. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. This method gives the chance to enter the revisions to be compared. @@ -1969,8 +2025,9 @@ repository URLs. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. This method gives the chance to enter the revisions to be compared. @@ -1993,7 +2050,8 @@ dname = self.splitPath(names[0])[0] from .SvnUrlSelectionDialog import SvnUrlSelectionDialog - dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, dname) + dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, + dname) if dlg.exec_() == QDialog.Accepted: urls, summary = dlg.getURLs() from .SvnDiffDialog import SvnDiffDialog @@ -2004,7 +2062,8 @@ def __svnGetFileForRevision(self, name, rev=""): """ - Private method to get a file for a specific revision from the repository. + Private method to get a file for a specific revision from the + repository. @param name file name to get from the repository (string) @keyparam rev revision to retrieve (integer or string) @@ -2017,7 +2076,8 @@ try: if rev: if isinstance(rev, int) or rev.isdecimal(): - rev = pysvn.Revision(pysvn.opt_revision_kind.number, int(rev)) + rev = pysvn.Revision( + pysvn.opt_revision_kind.number, int(rev)) elif rev.startswith("{"): dateStr = rev[1:-1] secs = QDateTime.fromString(dateStr, Qt.ISODate).toTime_t() @@ -2095,7 +2155,8 @@ except IOError: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Side-by-Side Difference"), - self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") + self.trUtf8( + """<p>The file <b>{0}</b> could not be read.</p>""") .format(name)) return @@ -2123,9 +2184,11 @@ """ Public method used to lock a file in the Subversion repository. - @param name file/directory name to be locked (string or list of strings) + @param name file/directory name to be locked (string or list of + strings) @param stealIt flag indicating a forced operation (boolean) - @param parent reference to the parent object of the subversion dialog (QWidget) + @param parent reference to the parent object of the subversion dialog + (QWidget) """ comment, ok = QInputDialog.getText( None, @@ -2170,9 +2233,11 @@ """ Public method used to unlock a file in the Subversion repository. - @param name file/directory name to be unlocked (string or list of strings) + @param name file/directory name to be unlocked (string or list of + strings) @param breakIt flag indicating a forced operation (boolean) - @param parent reference to the parent object of the subversion dialog (QWidget) + @param parent reference to the parent object of the subversion dialog + (QWidget) """ if isinstance(name, list): dname, fnames = self.splitPathList(name) @@ -2229,7 +2294,8 @@ if inside: msg = "switch {0} {1}".format(newUrl, projectPath) else: - msg = "relocate {0} {1} {2}".format(currUrl, newUrl, projectPath) + msg = "relocate {0} {1} {2}".format(currUrl, newUrl, + projectPath) client = self.getClient() dlg = \ SvnDialog(self.trUtf8('Relocating'), msg, client) @@ -2327,7 +2393,8 @@ locker = QMutexLocker(self.vcsExecutionMutex) try: for name in names: - client.add_to_changelist(name, clname, depth=pysvn.depth.infinity) + client.add_to_changelist(name, clname, + depth=pysvn.depth.infinity) except pysvn.ClientError as e: dlg.showError(e.args[0]) locker.unlock() @@ -2358,7 +2425,8 @@ ppath = e5App().getObject("Project").getProjectPath() locker = QMutexLocker(self.vcsExecutionMutex) try: - entries = client.get_changelist(ppath, depth=pysvn.depth.infinity) + entries = client.get_changelist(ppath, + depth=pysvn.depth.infinity) for entry in entries: changelist = entry[1] if changelist not in changelists: @@ -2369,9 +2437,9 @@ return changelists - ############################################################################ + ########################################################################### ## Private Subversion specific methods are below. - ############################################################################ + ########################################################################### def __svnURL(self, url): """ @@ -2386,7 +2454,8 @@ scheme = url[0] host = url[1] port, path = url[2].split("/", 1) - return "{0}:{1}:{2}/{3}".format(scheme, host, port, urllib.parse.quote(path)) + return "{0}:{1}:{2}/{3}".format(scheme, host, port, + urllib.parse.quote(path)) else: scheme = url[0] if scheme == "file": @@ -2397,7 +2466,8 @@ except ValueError: host = url[1][2:] path = "" - return "{0}://{1}/{2}".format(scheme, host, urllib.parse.quote(path)) + return "{0}://{1}/{2}".format(scheme, host, + urllib.parse.quote(path)) def svnNormalizeURL(self, url): """ @@ -2420,22 +2490,25 @@ url = "/{0}".format(url) return "{0}://{1}".format(protocol, url) - ############################################################################ + ########################################################################### ## Methods to get the helper objects are below. - ############################################################################ + ########################################################################### - def vcsGetProjectBrowserHelper(self, browser, project, isTranslationsBrowser=False): + def vcsGetProjectBrowserHelper(self, browser, project, + isTranslationsBrowser=False): """ - Public method to instanciate a helper object for the different project browsers. + Public method to instanciate a helper object for the different + project browsers. @param browser reference to the project browser object @param project 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) @return the project browser helper object """ from .ProjectBrowserHelper import SvnProjectBrowserHelper - return SvnProjectBrowserHelper(self, browser, project, isTranslationsBrowser) + return SvnProjectBrowserHelper(self, browser, project, + isTranslationsBrowser) def vcsGetProjectHelper(self, project): """ @@ -2447,13 +2520,15 @@ helper = self.__plugin.getProjectHelper() helper.setObjects(self, project) self.__wcng = \ - os.path.exists(os.path.join(project.getProjectPath(), ".svn", "format")) or \ - os.path.exists(os.path.join(project.getProjectPath(), "_svn", "format")) + os.path.exists( + os.path.join(project.getProjectPath(), ".svn", "format")) or \ + os.path.exists( + os.path.join(project.getProjectPath(), "_svn", "format")) return helper - ############################################################################ + ########################################################################### ## Status Monitor Thread methods - ############################################################################ + ########################################################################### def _createStatusMonitorThread(self, interval, project): """
--- a/Plugins/VcsPlugins/vcsSubversion/ConfigurationPage/SubversionPage.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/ConfigurationPage/SubversionPage.py Sat Oct 12 17:31:40 2013 +0200 @@ -9,7 +9,8 @@ from PyQt4.QtCore import pyqtSlot -from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase +from Preferences.ConfigurationPages.ConfigurationPageBase import \ + ConfigurationPageBase from .Ui_SubversionPage import Ui_SubversionPage @@ -31,14 +32,16 @@ # set initial values self.logSpinBox.setValue(self.__plugin.getPreferences("LogLimit")) - self.commitSpinBox.setValue(self.__plugin.getPreferences("CommitMessages")) + self.commitSpinBox.setValue( + self.__plugin.getPreferences("CommitMessages")) def save(self): """ Public slot to save the Subversion configuration. """ self.__plugin.setPreferences("LogLimit", self.logSpinBox.value()) - self.__plugin.setPreferences("CommitMessages", self.commitSpinBox.value()) + self.__plugin.setPreferences( + "CommitMessages", self.commitSpinBox.value()) @pyqtSlot() def on_configButton_clicked(self):
--- 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): """
--- a/Plugins/VcsPlugins/vcsSubversion/ProjectHelper.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/ProjectHelper.py Sat Oct 12 17:31:40 2013 +0200 @@ -45,15 +45,18 @@ """ Public method to generate the action objects. """ - self.vcsNewAct = E5Action(self.trUtf8('New from repository'), - UI.PixmapCache.getIcon("vcsCheckout.png"), - self.trUtf8('&New from repository...'), 0, 0, self, 'subversion_new') + self.vcsNewAct = E5Action( + self.trUtf8('New from repository'), + UI.PixmapCache.getIcon("vcsCheckout.png"), + self.trUtf8('&New from repository...'), 0, 0, self, + 'subversion_new') self.vcsNewAct.setStatusTip(self.trUtf8( 'Create a new project from the VCS repository' )) self.vcsNewAct.setWhatsThis(self.trUtf8( """<b>New from repository</b>""" - """<p>This creates a new local project from the VCS repository.</p>""" + """<p>This creates a new local project from the VCS""" + """ repository.</p>""" )) self.vcsNewAct.triggered[()].connect(self._vcsCheckout) self.actions.append(self.vcsNewAct) @@ -67,21 +70,24 @@ )) self.vcsUpdateAct.setWhatsThis(self.trUtf8( """<b>Update from repository</b>""" - """<p>This updates the local project from the VCS repository.</p>""" + """<p>This updates the local project from the VCS""" + """ repository.</p>""" )) self.vcsUpdateAct.triggered[()].connect(self._vcsUpdate) self.actions.append(self.vcsUpdateAct) - self.vcsCommitAct = E5Action(self.trUtf8('Commit changes to repository'), - UI.PixmapCache.getIcon("vcsCommit.png"), - self.trUtf8('&Commit changes to repository...'), 0, 0, self, - 'subversion_commit') + self.vcsCommitAct = E5Action( + self.trUtf8('Commit changes to repository'), + UI.PixmapCache.getIcon("vcsCommit.png"), + self.trUtf8('&Commit changes to repository...'), 0, 0, self, + 'subversion_commit') self.vcsCommitAct.setStatusTip(self.trUtf8( 'Commit changes to the local project to the VCS repository' )) self.vcsCommitAct.setWhatsThis(self.trUtf8( """<b>Commit changes to repository</b>""" - """<p>This commits changes to the local project to the VCS repository.</p>""" + """<p>This commits changes to the local project to the VCS""" + """ repository.</p>""" )) self.vcsCommitAct.triggered[()].connect(self._vcsCommit) self.actions.append(self.vcsCommitAct) @@ -109,9 +115,9 @@ )) self.svnLogBrowserAct.setWhatsThis(self.trUtf8( """<b>Show log browser</b>""" - """<p>This shows a dialog to browse the log of the local project.""" - """ A limited number of entries is shown first. More can be""" - """ retrieved later on.</p>""" + """<p>This shows a dialog to browse the log of the local""" + """ project. A limited number of entries is shown first. More""" + """ can be retrieved later on.</p>""" )) self.svnLogBrowserAct.triggered[()].connect(self.__svnLogBrowser) self.actions.append(self.svnLogBrowserAct) @@ -125,21 +131,24 @@ )) self.vcsDiffAct.setWhatsThis(self.trUtf8( """<b>Show difference</b>""" - """<p>This shows the difference of the local project to the repository.</p>""" + """<p>This shows the difference of the local project to the""" + """ repository.</p>""" )) self.vcsDiffAct.triggered[()].connect(self._vcsDiff) self.actions.append(self.vcsDiffAct) - self.svnExtDiffAct = E5Action(self.trUtf8('Show difference (extended)'), - UI.PixmapCache.getIcon("vcsDiff.png"), - self.trUtf8('Show difference (extended)'), - 0, 0, self, 'subversion_extendeddiff') + self.svnExtDiffAct = E5Action( + self.trUtf8('Show difference (extended)'), + UI.PixmapCache.getIcon("vcsDiff.png"), + self.trUtf8('Show difference (extended)'), + 0, 0, self, 'subversion_extendeddiff') self.svnExtDiffAct.setStatusTip(self.trUtf8( 'Show the difference of revisions of the project to the repository' )) self.svnExtDiffAct.setWhatsThis(self.trUtf8( """<b>Show difference (extended)</b>""" - """<p>This shows the difference of selectable revisions of the project.</p>""" + """<p>This shows the difference of selectable revisions of""" + """ the project.</p>""" )) self.svnExtDiffAct.triggered[()].connect(self.__svnExtendedDiff) self.actions.append(self.svnExtDiffAct) @@ -219,7 +228,8 @@ self.vcsPropsAct = E5Action(self.trUtf8('Command options'), self.trUtf8('Command &options...'), 0, 0, self, 'subversion_options') - self.vcsPropsAct.setStatusTip(self.trUtf8('Show the VCS command options')) + self.vcsPropsAct.setStatusTip(self.trUtf8( + 'Show the VCS command options')) self.vcsPropsAct.setWhatsThis(self.trUtf8( """<b>Command options...</b>""" """<p>This shows a dialog to edit the VCS command options.</p>""" @@ -250,7 +260,8 @@ )) self.vcsMergeAct.setWhatsThis(self.trUtf8( """<b>Merge</b>""" - """<p>This merges changes of a tag/revision into the local project.</p>""" + """<p>This merges changes of a tag/revision into the local""" + """ project.</p>""" )) self.vcsMergeAct.triggered[()].connect(self._vcsMerge) self.actions.append(self.vcsMergeAct) @@ -277,7 +288,8 @@ )) self.vcsResolveAct.setWhatsThis(self.trUtf8( """<b>Conflicts resolved</b>""" - """<p>This marks all conflicts of the local project as resolved.</p>""" + """<p>This marks all conflicts of the local project as""" + """ resolved.</p>""" )) self.vcsResolveAct.triggered[()].connect(self.__svnResolve) self.actions.append(self.vcsResolveAct) @@ -395,7 +407,8 @@ )) self.svnRelocateAct.setWhatsThis(self.trUtf8( """<b>Relocate</b>""" - """<p>This relocates the working copy to a new repository URL.</p>""" + """<p>This relocates the working copy to a new repository""" + """ URL.</p>""" )) self.svnRelocateAct.triggered[()].connect(self.__svnRelocate) self.actions.append(self.svnRelocateAct) @@ -422,7 +435,8 @@ )) self.svnConfigAct.setWhatsThis(self.trUtf8( """<b>Configure</b>""" - """<p>Show the configuration dialog with the Subversion page selected.</p>""" + """<p>Show the configuration dialog with the Subversion page""" + """ selected.</p>""" )) self.svnConfigAct.triggered[()].connect(self.__svnConfigure) self.actions.append(self.svnConfigAct) @@ -437,7 +451,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) @@ -525,13 +540,15 @@ def __svnExtendedDiff(self): """ - Private slot used to perform a svn diff with the selection of revisions. + Private slot used to perform a svn diff with the selection of + revisions. """ self.vcs.svnExtendedDiff(self.project.ppath) def __svnUrlDiff(self): """ - Private slot used to perform a svn diff with the selection of repository URLs. + Private slot used to perform a svn diff with the selection of + repository URLs. """ self.vcs.svnUrlDiff(self.project.ppath) @@ -557,7 +574,8 @@ """ Private slot to open the configuration dialog. """ - e5App().getObject("UserInterface").showPreferences("zzz_subversionPage") + e5App().getObject("UserInterface")\ + .showPreferences("zzz_subversionPage") def __svnChangeLists(self): """
--- a/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -10,8 +10,8 @@ import os from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot -from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, QFont, \ - QTreeWidgetItem +from PyQt4.QtGui import QHeaderView, QLineEdit, QDialog, QDialogButtonBox, \ + QFont, QTreeWidgetItem from E5Gui import E5MessageBox @@ -108,7 +108,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.process is not None and \ self.process.state() != QProcess.NotRunning: @@ -119,7 +120,8 @@ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) self.inputGroup.setEnabled(False) self.inputGroup.hide() @@ -178,7 +180,8 @@ self.process.setReadChannel(QProcess.StandardOutput) while self.process.canReadLine(): - s = str(self.process.readLine(), self.__ioEncoding, 'replace').strip() + s = str(self.process.readLine(), self.__ioEncoding, 'replace')\ + .strip() rev, s = s.split(None, 1) try: author, text = s.split(' ', 1)
--- a/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -39,8 +39,8 @@ self.process = None self.vcs = vcs - self.rx_status = \ - QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') + self.rx_status = QRegExp( + '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') # flags (8 or 9 anything), revision, changed rev, author, path self.rx_status2 = \ QRegExp('(.{8,9})\\s+(.+)\\s*') @@ -62,7 +62,8 @@ if current is not None: changelist = current.text() if changelist in self.changeListsDict: - self.filesList.addItems(sorted(self.changeListsDict[changelist])) + self.filesList.addItems( + sorted(self.changeListsDict[changelist])) def start(self, path): """ @@ -72,7 +73,8 @@ """ self.changeListsDict = {} - self.filesLabel.setText(self.trUtf8("Files (relative to {0}):").format(path)) + self.filesLabel.setText( + self.trUtf8("Files (relative to {0}):").format(path)) self.errorGroup.hide() self.intercept = False @@ -136,7 +138,8 @@ if len(self.changeListsDict) == 0: self.changeLists.addItem(self.trUtf8("No changelists found")) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) else: self.changeLists.addItems(sorted(self.changeListsDict.keys())) self.changeLists.setCurrentRow(0) @@ -176,16 +179,22 @@ s = str(self.process.readLine(), Preferences.getSystem("IOEncoding"), 'replace') - if self.currentChangelist != "" and self.rx_status.exactMatch(s): + if self.currentChangelist != "" and \ + self.rx_status.exactMatch(s): file = self.rx_status.cap(5).strip() filename = file.replace(self.path + os.sep, "") - if filename not in self.changeListsDict[self.currentChangelist]: - self.changeListsDict[self.currentChangelist].append(filename) - elif self.currentChangelist != "" and self.rx_status2.exactMatch(s): + if filename not in \ + self.changeListsDict[self.currentChangelist]: + self.changeListsDict[self.currentChangelist].append( + filename) + elif self.currentChangelist != "" and \ + self.rx_status2.exactMatch(s): file = self.rx_status2.cap(2).strip() filename = file.replace(self.path + os.sep, "") - if filename not in self.changeListsDict[self.currentChangelist]: - self.changeListsDict[self.currentChangelist].append(filename) + if filename not in \ + self.changeListsDict[self.currentChangelist]: + self.changeListsDict[self.currentChangelist].append( + filename) elif self.rx_changelist.exactMatch(s): self.currentChangelist = self.rx_changelist.cap(1) if self.currentChangelist not in self.changeListsDict:
--- a/Plugins/VcsPlugins/vcsSubversion/SvnCopyDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnCopyDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -22,7 +22,8 @@ class SvnCopyDialog(QDialog, Ui_SvnCopyDialog): """ - Class implementing a dialog to enter the data for a copy or rename operation. + Class implementing a dialog to enter the data for a copy or rename + operation. """ def __init__(self, source, parent=None, move=False, force=False): """ @@ -63,7 +64,8 @@ if not os.path.isabs(target): sourceDir = os.path.dirname(self.sourceEdit.text()) target = os.path.join(sourceDir, target) - return Utilities.toNativeSeparators(target), self.forceCheckBox.isChecked() + return (Utilities.toNativeSeparators(target), + self.forceCheckBox.isChecked()) @pyqtSlot() def on_dirButton_clicked(self):
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -48,7 +48,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.proc is not None and \ self.proc.state() != QProcess.NotRunning: @@ -68,7 +69,8 @@ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) if Preferences.getVCS("AutoClose") and \ self.normal and \
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,13 +4,15 @@ # """ -Module implementing a dialog to show the output of the svn diff command process. +Module implementing a dialog to show the output of the svn diff command +process. """ import os from PyQt4.QtCore import QTimer, QFileInfo, QProcess, pyqtSlot, Qt -from PyQt4.QtGui import QWidget, QColor, QLineEdit, QBrush, QTextCursor, QDialogButtonBox +from PyQt4.QtGui import QWidget, QColor, QLineEdit, QBrush, QTextCursor, \ + QDialogButtonBox from E5Gui.E5Application import e5App from E5Gui import E5MessageBox, E5FileDialog @@ -23,7 +25,8 @@ class SvnDiffDialog(QWidget, Ui_SvnDiffDialog): """ - Class implementing a dialog to show the output of the svn diff command process. + Class implementing a dialog to show the output of the svn diff command + process. """ def __init__(self, vcs, parent=None): """ @@ -88,7 +91,8 @@ Public slot to start the svn diff command. @param fn filename to be diffed (string) - @param versions list of versions to be diffed (list of up to 2 strings or None) + @param versions list of versions to be diffed (list of up to 2 strings + or None) @keyparam urls list of repository URLs (list of 2 strings) @keyparam summary flag indicating a summarizing diff (only valid for URL diffs) (boolean) @@ -194,7 +198,8 @@ self.buttonBox.button(QDialogButtonBox.Save).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) tc = self.contents.textCursor() tc.movePosition(QTextCursor.Start) @@ -205,7 +210,8 @@ self.filesCombo.addItem(self.trUtf8("<End>"), -1) for oldFile, newFile, pos in sorted(self.__fileSeparators): if oldFile != newFile: - self.filesCombo.addItem("{0}\n{1}".format(oldFile, newFile), pos) + self.filesCombo.addItem( + "{0}\n{1}".format(oldFile, newFile), pos) else: self.filesCombo.addItem(oldFile, pos) @@ -244,7 +250,8 @@ self.__oldFile = self.__extractFileName(line) else: self.__fileSeparators.append( - (self.__oldFile, self.__extractFileName(line), self.__oldFileLine)) + (self.__oldFile, self.__extractFileName(line), + self.__oldFileLine)) def __readStdout(self): """ @@ -266,9 +273,11 @@ line.startswith("+++ "): self.__processFileLine(line) - if line.startswith('+') or line.startswith('>') or line.startswith('A '): + if line.startswith('+') or line.startswith('>') or \ + line.startswith('A '): format = self.cAddedFormat - elif line.startswith('-') or line.startswith('<') or line.startswith('D '): + elif line.startswith('-') or line.startswith('<') or \ + line.startswith('D '): format = self.cRemovedFormat elif line.startswith('@@'): format = self.cLineNoFormat @@ -330,7 +339,8 @@ # step 2: move cursor to desired line tc = self.contents.textCursor() delta = tc.blockNumber() - para - tc.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, delta) + tc.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, + delta) self.contents.setTextCursor(tc) self.contents.ensureCursorVisible()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -54,9 +54,12 @@ self.toDate.setDisplayFormat("yyyy-MM-dd") self.fromDate.setDate(QDate.currentDate()) self.toDate.setDate(QDate.currentDate()) - self.fieldCombo.setCurrentIndex(self.fieldCombo.findText(self.trUtf8("Message"))) - self.limitSpinBox.setValue(self.vcs.getPlugin().getPreferences("LogLimit")) - self.stopCheckBox.setChecked(self.vcs.getPlugin().getPreferences("StopLogOnCopy")) + self.fieldCombo.setCurrentIndex( + self.fieldCombo.findText(self.trUtf8("Message"))) + self.limitSpinBox.setValue( + self.vcs.getPlugin().getPreferences("LogLimit")) + self.stopCheckBox.setChecked( + self.vcs.getPlugin().getPreferences("StopLogOnCopy")) self.__messageRole = Qt.UserRole self.__changesRole = Qt.UserRole + 1 @@ -68,15 +71,18 @@ self.rx_sep1 = QRegExp('\\-+\\s*') self.rx_sep2 = QRegExp('=+\\s*') - self.rx_rev1 = QRegExp('rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') + self.rx_rev1 = QRegExp( + 'rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') # "rev" followed by one or more decimals followed by a colon followed - # anything up to " | " (twice) followed by one or more decimals followed - # by anything - self.rx_rev2 = QRegExp('r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') + # anything up to " | " (twice) followed by one or more decimals + # followed by anything + self.rx_rev2 = QRegExp( + 'r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') # "r" followed by one or more decimals followed by " | " followed - # anything up to " | " (twice) followed by one or more decimals followed - # by anything - self.rx_flags1 = QRegExp(r""" ([ADM])\s(.*)\s+\(\w+\s+(.*):([0-9]+)\)\s*""") + # anything up to " | " (twice) followed by one or more decimals + # followed by anything + self.rx_flags1 = QRegExp( + r""" ([ADM])\s(.*)\s+\(\w+\s+(.*):([0-9]+)\)\s*""") # three blanks followed by A or D or M followed by path followed by # path copied from followed by copied from revision self.rx_flags2 = QRegExp(' ([ADM]) (.*)\\s*') @@ -281,7 +287,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.process is not None and \ self.process.state() != QProcess.NotRunning: @@ -341,7 +348,8 @@ self.__generateLogItem(log["author"], log["date"], log["message"], log["revision"], changedPaths) dt = QDate.fromString(log["date"], Qt.ISODate) - if not self.__maxDate.isValid() and not self.__minDate.isValid(): + if not self.__maxDate.isValid() and \ + not self.__minDate.isValid(): self.__maxDate = dt self.__minDate = dt else: @@ -416,7 +424,8 @@ @param rev2 second revision number (integer) """ if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked(): - self.vcs.svnSbsDiff(self.filename, revisions=(str(rev1), str(rev2))) + self.vcs.svnSbsDiff(self.filename, + revisions=(str(rev1), str(rev2))) else: if self.diff is None: from .SvnDiffDialog import SvnDiffDialog @@ -459,14 +468,16 @@ self.__resortFiles() self.diffPreviousButton.setEnabled( - current != self.logTree.topLevelItem(self.logTree.topLevelItemCount() - 1)) + current != self.logTree.topLevelItem( + self.logTree.topLevelItemCount() - 1)) @pyqtSlot() def on_logTree_itemSelectionChanged(self): """ Private slot called, when the selection has changed. """ - self.diffRevisionsButton.setEnabled(len(self.logTree.selectedItems()) == 2) + self.diffRevisionsButton.setEnabled( + len(self.logTree.selectedItems()) == 2) @pyqtSlot() def on_nextButton_clicked(self): @@ -487,7 +498,8 @@ return rev2 = int(itm.text(0)) - itm = self.logTree.topLevelItem(self.logTree.indexOfTopLevelItem(itm) + 1) + itm = self.logTree.topLevelItem( + self.logTree.indexOfTopLevelItem(itm) + 1) if itm is None: self.diffPreviousButton.setEnabled(False) return @@ -561,7 +573,8 @@ fieldIndex = 0 txt = self.rxEdit.text() if txt.startswith("^"): - searchRx = QRegExp("^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) + searchRx = QRegExp( + "^\s*{0}".format(txt[1:]), Qt.CaseInsensitive) else: searchRx = QRegExp(txt, Qt.CaseInsensitive) else:
--- a/Plugins/VcsPlugins/vcsSubversion/SvnLogDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnLogDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -10,7 +10,8 @@ import os from PyQt4.QtCore import QTimer, QByteArray, QProcess, QRegExp, QUrl, pyqtSlot -from PyQt4.QtGui import QWidget, QLineEdit, QApplication, QTextCursor, QDialogButtonBox +from PyQt4.QtGui import QWidget, QLineEdit, QApplication, QTextCursor, \ + QDialogButtonBox from E5Gui import E5MessageBox @@ -22,7 +23,8 @@ class SvnLogDialog(QWidget, Ui_SvnLogDialog): """ - Class implementing a dialog to show the output of the svn log command process. + Class implementing a dialog to show the output of the svn log command + process. The dialog is nonmodal. Clicking a link in the upper text pane shows a diff of the versions. @@ -54,14 +56,16 @@ self.rx_sep = QRegExp('\\-+\\s*') self.rx_sep2 = QRegExp('=+\\s*') - self.rx_rev = QRegExp('rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') + self.rx_rev = QRegExp( + 'rev ([0-9]+): ([^|]*) \| ([^|]*) \| ([0-9]+) .*') # "rev" followed by one or more decimals followed by a colon followed - # anything up to " | " (twice) followed by one or more decimals followed - # by anything - self.rx_rev2 = QRegExp('r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') + # anything up to " | " (twice) followed by one or more decimals + # followed by anything + self.rx_rev2 = QRegExp( + 'r([0-9]+) \| ([^|]*) \| ([^|]*) \| ([0-9]+) .*') # "r" followed by one or more decimals followed by " | " followed - # anything up to " | " (twice) followed by one or more decimals followed - # by anything + # anything up to " | " (twice) followed by one or more decimals + # followed by anything self.rx_flags = QRegExp(' ([ADM])( .*)\\s*') # three blanks followed by A or D or M self.rx_changed = QRegExp('Changed .*\\s*')
--- a/Plugins/VcsPlugins/vcsSubversion/SvnMergeDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnMergeDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -17,12 +17,15 @@ """ Class implementing a dialog to enter the data for a merge operation. """ - def __init__(self, mergelist1, mergelist2, targetlist, force=False, parent=None): + def __init__(self, mergelist1, mergelist2, targetlist, force=False, + parent=None): """ Constructor - @param mergelist1 list of previously entered URLs/revisions (list of strings) - @param mergelist2 list of previously entered URLs/revisions (list of strings) + @param mergelist1 list of previously entered URLs/revisions + (list of strings) + @param mergelist2 list of previously entered URLs/revisions + (list of strings) @param targetlist list of previously entered targets (list of strings) @param force flag indicating a forced merge (boolean) @param parent parent widget (QWidget)
--- a/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnNewProjectOptionsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing the Subversion Options Dialog for a new project from the repository. +Module implementing the Subversion Options Dialog for a new project from the +repository. """ import os @@ -24,7 +25,8 @@ class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog): """ - Class implementing the Options Dialog for a new project from the repository. + Class implementing the Options Dialog for a new project from the + repository. """ def __init__(self, vcs, parent=None): """ @@ -52,7 +54,8 @@ self.localProtocol = True self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators( - Preferences.getMultiProject("Workspace") or Utilities.getHomeDir())) + Preferences.getMultiProject("Workspace") or + Utilities.getHomeDir())) @pyqtSlot() def on_vcsUrlButton_clicked(self): @@ -67,11 +70,13 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsUrlEdit.setText( + Utilities.toNativeSeparators(directory)) else: from .SvnRepoBrowserDialog import SvnRepoBrowserDialog dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) - dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) + dlg.start( + self.protocolCombo.currentText() + self.vcsUrlEdit.text()) if dlg.exec_() == QDialog.Accepted: url = dlg.getSelectedUrl() if url: @@ -93,7 +98,8 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsProjectDirEdit.setText( + Utilities.toNativeSeparators(directory)) def on_layoutCheckBox_toggled(self, checked): """
--- a/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnOptionsDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to enter options used to start a project in the VCS. +Module implementing a dialog to enter options used to start a project in +the VCS. """ import os @@ -66,11 +67,13 @@ E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) if directory: - self.vcsUrlEdit.setText(Utilities.toNativeSeparators(directory)) + self.vcsUrlEdit.setText( + Utilities.toNativeSeparators(directory)) else: from .SvnRepoBrowserDialog import SvnRepoBrowserDialog dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self) - dlg.start(self.protocolCombo.currentText() + self.vcsUrlEdit.text()) + dlg.start( + self.protocolCombo.currentText() + self.vcsUrlEdit.text()) if dlg.exec_() == QDialog.Accepted: url = dlg.getSelectedUrl() if url:
--- a/Plugins/VcsPlugins/vcsSubversion/SvnPropListDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnPropListDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -4,7 +4,8 @@ # """ -Module implementing a dialog to show the output of the svn proplist command process. +Module implementing a dialog to show the output of the svn proplist command +process. """ from PyQt4.QtCore import QTimer, QProcess, QProcessEnvironment, QRegExp, Qt @@ -19,7 +20,8 @@ class SvnPropListDialog(QWidget, Ui_SvnPropListDialog): """ - Class implementing a dialog to show the output of the svn proplist command process. + Class implementing a dialog to show the output of the svn proplist command + process. """ def __init__(self, vcs, parent=None): """ @@ -129,7 +131,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.process is not None and \ self.process.state() != QProcess.NotRunning: @@ -186,13 +189,15 @@ 'replace') if self.rx_path.exactMatch(s): if self.lastProp: - self.__generateItem(self.lastPath, self.lastProp, self.propBuffer) + self.__generateItem( + self.lastPath, self.lastProp, self.propBuffer) self.lastPath = self.rx_path.cap(1) self.lastProp = None self.propBuffer = "" elif self.rx_prop.exactMatch(s): if self.lastProp: - self.__generateItem(self.lastPath, self.lastProp, self.propBuffer) + self.__generateItem( + self.lastPath, self.lastProp, self.propBuffer) self.lastProp = self.rx_prop.cap(1) self.propBuffer = self.rx_prop.cap(2) else:
--- a/Plugins/VcsPlugins/vcsSubversion/SvnPropSetDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnPropSetDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -58,4 +58,5 @@ if self.fileRadioButton.isChecked(): return (self.propNameEdit.text(), True, self.propFileEdit.text()) else: - return (self.propNameEdit.text(), False, self.propTextEdit.toPlainText()) + return (self.propNameEdit.text(), False, + self.propTextEdit.toPlainText())
--- a/Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -58,10 +58,12 @@ self.__ignoreExpand = False self.intercept = False - self.__rx_dir = \ - QRegExp(r"""\s*([0-9]+)\s+(\w+)\s+((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)\s*""") - self.__rx_file = \ - QRegExp(r"""\s*([0-9]+)\s+(\w+)\s+([0-9]+)\s((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)\s*""") + self.__rx_dir = QRegExp( + r"""\s*([0-9]+)\s+(\w+)\s+""" + r"""((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)\s*""") + self.__rx_file = QRegExp( + r"""\s*([0-9]+)\s+(\w+)\s+([0-9]+)\s""" + r"""((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)\s*""") def closeEvent(self, e): """ @@ -163,11 +165,13 @@ finished = process.waitForFinished(30000) if finished: if process.exitCode() == 0: - output = str(process.readAllStandardOutput(), ioEncoding, 'replace') + output = str(process.readAllStandardOutput(), ioEncoding, + 'replace') for line in output.splitlines(): line = line.strip() if line.startswith('<root>'): - repoRoot = line.replace('<root>', '').replace('</root>', '') + repoRoot = line.replace('<root>', '')\ + .replace('</root>', '') break else: error = str(process.readAllStandardError(), @@ -209,14 +213,16 @@ self.__finish() return self.__ignoreExpand = True - itm = self.__generateItem(repoRoot, "", "", "", "", "dir", repoRoot) + itm = self.__generateItem( + repoRoot, "", "", "", "", "dir", repoRoot) itm.setExpanded(True) self.parentItem = itm urlPart = repoRoot for element in url.replace(repoRoot, "").split("/"): if element: urlPart = "{0}/{1}".format(urlPart, element) - itm = self.__generateItem(element, "", "", "", "", "dir", urlPart) + itm = self.__generateItem( + element, "", "", "", "", "dir", urlPart) itm.setExpanded(True) self.parentItem = itm itm.setExpanded(False) @@ -343,7 +349,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.process is not None and \ self.process.state() != QProcess.NotRunning: @@ -400,7 +407,8 @@ else: continue url = "{0}/{1}".format(self.repoUrl, name) - self.__generateItem(name, revision, author, size, date, nodekind, url) + self.__generateItem( + name, revision, author, size, date, nodekind, url) def __readStderr(self): """
--- a/Plugins/VcsPlugins/vcsSubversion/SvnRevisionSelectionDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnRevisionSelectionDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -15,7 +15,8 @@ class SvnRevisionSelectionDialog(QDialog, Ui_SvnRevisionSelectionDialog): """ - Class implementing a dialog to enter the revisions for the svn diff command. + Class implementing a dialog to enter the revisions for the svn diff + command. """ def __init__(self, parent=None): """ @@ -63,7 +64,8 @@ return numberSpinBox.value() elif dateButton.isChecked(): return "{{{0}}}".format( - QDateTime(dateEdit.date(), timeEdit.time()).toString(Qt.ISODate)) + QDateTime(dateEdit.date(), timeEdit.time())\ + .toString(Qt.ISODate)) elif headButton.isChecked(): return "HEAD" elif workingButton.isChecked():
--- a/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -188,8 +188,8 @@ '*': self.trUtf8('no'), } - self.rx_status = \ - QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') + self.rx_status = QRegExp( + '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') # flags (8 or 9 anything), revision, changed rev, author, path self.rx_status2 = \ QRegExp('(.{8,9})\\s+(.+)\\s*') @@ -413,7 +413,8 @@ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) self.inputGroup.setEnabled(False) self.inputGroup.hide()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py Sat Oct 12 17:31:40 2013 +0200 @@ -33,8 +33,8 @@ self.rx_status1 = \ QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') - self.rx_status2 = \ - QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') + self.rx_status2 = QRegExp( + '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') def _performMonitor(self): """ @@ -72,8 +72,8 @@ if procStarted: finished = process.waitForFinished(300000) if finished and process.exitCode() == 0: - output = \ - str(process.readAllStandardOutput(), self.__ioEncoding, 'replace') + output = str(process.readAllStandardOutput(), + self.__ioEncoding, 'replace') states = {} for line in output.splitlines(): if self.rx_status1.exactMatch(line): @@ -100,23 +100,26 @@ states[name] = status try: if self.reportedStates[name] != status: - self.statusList.append("{0} {1}".format(status, name)) + self.statusList.append( + "{0} {1}".format(status, name)) except KeyError: - self.statusList.append("{0} {1}".format(status, name)) + self.statusList.append( + "{0} {1}".format(status, name)) for name in list(self.reportedStates.keys()): if name not in states: self.statusList.append(" {0}".format(name)) self.reportedStates = states - return True, \ - self.trUtf8("Subversion status checked successfully (using svn)") + return True, self.trUtf8( + "Subversion status checked successfully (using svn)") else: process.kill() process.waitForFinished() return False, \ str(process.readAllStandardError(), - Preferences.getSystem("IOEncoding"), - 'replace') + Preferences.getSystem("IOEncoding"), + 'replace') else: process.kill() process.waitForFinished() - return False, self.trUtf8("Could not start the Subversion process.") + return False, self.trUtf8( + "Could not start the Subversion process.")
--- a/Plugins/VcsPlugins/vcsSubversion/SvnTagBranchListDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnTagBranchListDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -49,8 +49,9 @@ self.process.readyReadStandardOutput.connect(self.__readStdout) self.process.readyReadStandardError.connect(self.__readStderr) - self.rx_list = \ - QRegExp(r"""\w*\s*(\d+)\s+(\w+)\s+\d*\s*((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)/\s*""") + self.rx_list = QRegExp( + r"""\w*\s*(\d+)\s+(\w+)\s+\d*\s*""" + r"""((?:\w+\s+\d+|[0-9.]+\s+\w+)\s+[0-9:]+)\s+(.+)/\s*""") def closeEvent(self, e): """ @@ -94,9 +95,10 @@ if reposURL is None: E5MessageBox.critical(self, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The list operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The list operation""" + """ will be aborted""")) self.close() return @@ -127,16 +129,19 @@ reposPath, ok = QInputDialog.getText( self, self.trUtf8("Subversion List"), - self.trUtf8("Enter the repository URL containing the tags or branches"), + self.trUtf8("Enter the repository URL containing the tags" + " or branches"), QLineEdit.Normal, self.vcs.svnNormalizeURL(reposURL)) if not ok: self.close() return if not reposPath: - E5MessageBox.critical(self, + E5MessageBox.critical( + self, self.trUtf8("Subversion List"), - self.trUtf8("""The repository URL is empty. Aborting...""")) + self.trUtf8("""The repository URL is empty.""" + """ Aborting...""")) self.close() return args.append(reposPath) @@ -161,7 +166,8 @@ def __finish(self): """ - Private slot called when the process finished or the user pressed the button. + Private slot called when the process finished or the user pressed the + button. """ if self.process is not None and \ self.process.state() != QProcess.NotRunning: @@ -172,7 +178,8 @@ self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False) self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) - self.buttonBox.button(QDialogButtonBox.Close).setFocus(Qt.OtherFocusReason) + self.buttonBox.button(QDialogButtonBox.Close).setFocus( + Qt.OtherFocusReason) self.inputGroup.setEnabled(False) self.inputGroup.hide()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnUrlSelectionDialog.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnUrlSelectionDialog.py Sat Oct 12 17:31:40 2013 +0200 @@ -50,7 +50,8 @@ if reposURL is None: E5MessageBox.critical(self, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" + self.trUtf8( + """The URL of the project repository could not be""" """ retrieved from the working copy. The operation will""" """ be aborted""")) self.reject()
--- a/Plugins/VcsPlugins/vcsSubversion/subversion.py Sat Oct 12 15:01:28 2013 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/subversion.py Sat Oct 12 17:31:40 2013 +0200 @@ -97,14 +97,16 @@ self.repoBrowser = None # regular expression object for evaluation of the status output - self.rx_status1 = QRegExp('(.{8})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)') + self.rx_status1 = QRegExp( + '(.{8})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)') self.rx_status2 = QRegExp('(.{8})\\s+(.+)\\s*') self.statusCache = {} self.__commitData = {} self.__commitDialog = None - self.__wcng = True # assume new generation working copy metadata format + self.__wcng = True # assume new generation working copy + # metadata format def getPlugin(self): """ @@ -139,7 +141,8 @@ """ Public method used to test for the presence of the svn executable. - @return flag indicating the existance (boolean) and an error message (string) + @return flag indicating the existance (boolean) and an error message + (string) """ self.versionStr = '' errMsg = "" @@ -154,7 +157,8 @@ output = \ str(process.readAllStandardOutput(), ioEncoding, 'replace') self.versionStr = output.split()[2] - v = list(re.match(r'.*?(\d+)\.(\d+)\.?(\d+)?', self.versionStr).groups()) + v = list(re.match(r'.*?(\d+)\.(\d+)\.?(\d+)?', self.versionStr) + .groups()) for i in range(3): try: v[i] = int(v[i]) @@ -166,11 +170,12 @@ return True, errMsg else: if finished: - errMsg = \ - self.trUtf8("The svn process finished with the exit code {0}")\ + errMsg = self.trUtf8( + "The svn process finished with the exit code {0}")\ .format(process.exitCode()) else: - errMsg = self.trUtf8("The svn process did not finish within 30s.") + errMsg = self.trUtf8( + "The svn process did not finish within 30s.") else: errMsg = self.trUtf8("Could not start the svn executable.") @@ -192,7 +197,8 @@ def vcsConvertProject(self, vcsDataDict, project): """ - Public method to convert an uncontrolled project to a version controlled project. + Public method to convert an uncontrolled project to a version + controlled project. @param vcsDataDict dictionary of data required for the conversion @param project reference to the project object @@ -201,9 +207,10 @@ if not success: E5MessageBox.critical(self.__ui, self.trUtf8("Create project in repository"), - self.trUtf8("""The project could not be created in the repository.""" - """ Maybe the given repository doesn't exist or the""" - """ repository server is down.""")) + self.trUtf8( + """The project could not be created in the repository.""" + """ Maybe the given repository doesn't exist or the""" + """ repository server is down.""")) else: cwdIsPpath = False if os.getcwd() == project.ppath: @@ -223,9 +230,10 @@ if not os.path.isfile(pfn): E5MessageBox.critical(self.__ui, self.trUtf8("New project"), - self.trUtf8("""The project could not be checked out of the""" - """ repository.<br />""" - """Restoring the original contents.""")) + self.trUtf8( + """The project could not be checked out of the""" + """ repository.<br />""" + """Restoring the original contents.""")) if os.getcwd() == project.ppath: os.chdir(os.path.dirname(project.ppath)) cwdIsPpath = True @@ -245,7 +253,8 @@ def vcsImport(self, vcsDataDict, projectDir, noDialog=False): """ - Public method used to import the project into the Subversion repository. + Public method used to import the project into the Subversion + repository. @param vcsDataDict dictionary of data required for the import @param projectDir project directory (string) @@ -274,7 +283,8 @@ os.mkdir(os.path.join(tmpDir, project)) os.mkdir(os.path.join(tmpDir, project, 'branches')) os.mkdir(os.path.join(tmpDir, project, 'tags')) - shutil.copytree(projectDir, os.path.join(tmpDir, project, 'trunk')) + shutil.copytree( + projectDir, os.path.join(tmpDir, project, 'trunk')) else: shutil.copytree(projectDir, os.path.join(tmpDir, project)) except OSError: @@ -293,7 +303,8 @@ status = self.startSynchronizedProcess(QProcess(), "svn", args, os.path.join(tmpDir, project)) else: - dia = SvnDialog(self.trUtf8('Importing project into Subversion repository')) + dia = SvnDialog( + self.trUtf8('Importing project into Subversion repository')) res = dia.startProcess(args, os.path.join(tmpDir, project)) if res: dia.exec_() @@ -304,7 +315,8 @@ def vcsCheckout(self, vcsDataDict, projectDir, noDialog=False): """ - Public method used to check the project out of the Subversion repository. + Public method used to check the project out of the Subversion + repository. @param vcsDataDict dictionary of data required for the checkout @param projectDir project directory to create (string) @@ -326,7 +338,8 @@ if tag is None or tag == '': svnUrl = '{0}/trunk'.format(vcsDir) else: - if not tag.startswith('tags') and not tag.startswith('branches'): + if not tag.startswith('tags') and \ + not tag.startswith('branches'): type, ok = QInputDialog.getItem( None, self.trUtf8("Subversion Checkout"), @@ -352,7 +365,8 @@ if noDialog: return self.startSynchronizedProcess(QProcess(), 'svn', args) else: - dia = SvnDialog(self.trUtf8('Checking project out of Subversion repository')) + dia = SvnDialog( + self.trUtf8('Checking project out of Subversion repository')) res = dia.startProcess(args) if res: dia.exec_() @@ -360,7 +374,8 @@ def vcsExport(self, vcsDataDict, projectDir): """ - Public method used to export a directory from the Subversion repository. + Public method used to export a directory from the Subversion + repository. @param vcsDataDict dictionary of data required for the checkout @param projectDir project directory to create (string) @@ -378,7 +393,8 @@ if tag is None or tag == '': svnUrl = '{0}/trunk'.format(vcsDir) else: - if not tag.startswith('tags') and not tag.startswith('branches'): + if not tag.startswith('tags') and \ + not tag.startswith('branches'): type, ok = QInputDialog.getItem( None, self.trUtf8("Subversion Export"), @@ -401,7 +417,8 @@ args.append(self.__svnURL(svnUrl)) args.append(projectDir) - dia = SvnDialog(self.trUtf8('Exporting project from Subversion repository')) + dia = SvnDialog( + self.trUtf8('Exporting project from Subversion repository')) res = dia.startProcess(args) if res: dia.exec_() @@ -409,10 +426,11 @@ def vcsCommit(self, name, message, noDialog=False): """ - Public method used to make the change of a file/directory permanent in the - Subversion repository. + Public method used to make the change of a file/directory permanent + in the Subversion repository. - @param name file/directory name to be committed (string or list of strings) + @param name file/directory name to be committed (string or list of + strings) @param message message for this operation (string) @param noDialog flag indicating quiet operations """ @@ -455,11 +473,13 @@ if os.path.isdir(nam): project = e5App().getObject("Project") if nam == project.getProjectPath(): - ok &= project.checkAllScriptsDirty(reportSyntaxErrors=True) and \ - project.checkDirty() + ok &= project.checkAllScriptsDirty( + reportSyntaxErrors=True) and \ + project.checkDirty() continue elif os.path.isfile(nam): - editor = e5App().getObject("ViewManager").getOpenEditor(nam) + editor = e5App().getObject("ViewManager")\ + .getOpenEditor(nam) if editor: ok &= editor.checkDirty() if not ok: @@ -468,8 +488,9 @@ if not ok: res = E5MessageBox.yesNo(self.__ui, self.trUtf8("Commit Changes"), - self.trUtf8("""The commit affects files, that have unsaved""" - """ changes. Shall the commit be continued?"""), + self.trUtf8( + """The commit affects files, that have unsaved""" + """ changes. Shall the commit be continued?"""), icon=E5MessageBox.Warning) if not res: return @@ -477,10 +498,10 @@ if self.__commitDialog is not None: msg = self.__commitDialog.logMessage() if self.__commitDialog.hasChangelists(): - changelists, keepChangelists = self.__commitDialog.changelistsData() + changelists, keepChangelists = \ + self.__commitDialog.changelistsData() else: changelists, keepChangelists = [], False -## self.__commitDialog.accepted.disconnect(self.__vcsCommit_Step2) self.__commitDialog.deleteLater() self.__commitDialog = None else: @@ -514,7 +535,8 @@ if noDialog: self.startSynchronizedProcess(QProcess(), "svn", args, dname) else: - dia = SvnDialog(self.trUtf8('Commiting changes to Subversion repository')) + dia = SvnDialog( + self.trUtf8('Commiting changes to Subversion repository')) res = dia.startProcess(args, dname) if res: dia.exec_() @@ -523,9 +545,11 @@ def vcsUpdate(self, name, noDialog=False): """ - Public method used to update a file/directory with the Subversion repository. + Public method used to update a file/directory with the Subversion + repository. - @param name file/directory name to be updated (string or list of strings) + @param name file/directory name to be updated (string or list of + strings) @param noDialog flag indicating quiet operations (boolean) @return flag indicating, that the update contained an add or delete (boolean) @@ -548,7 +572,8 @@ self.startSynchronizedProcess(QProcess(), "svn", args, dname) res = False else: - dia = SvnDialog(self.trUtf8('Synchronizing with the Subversion repository')) + dia = SvnDialog( + self.trUtf8('Synchronizing with the Subversion repository')) res = dia.startProcess(args, dname, True) if res: dia.exec_() @@ -558,7 +583,8 @@ def vcsAdd(self, name, isDir=False, noDialog=False): """ - Public method used to add a file/directory to the Subversion repository. + Public method used to add a file/directory to the Subversion + repository. @param name file/directory name to be added (string) @param isDir flag indicating name is a directory (boolean) @@ -591,15 +617,18 @@ if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled while os.path.normcase(dname) != os.path.normcase(repodir) and \ - (os.path.normcase(dname) not in self.statusCache or \ - self.statusCache[os.path.normcase(dname)] == self.canBeAdded): - # add directories recursively, if they aren't in the repository already + (os.path.normcase(dname) not in self.statusCache or \ + self.statusCache[os.path.normcase(dname)] == + self.canBeAdded): + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) wdir = dname else: while not os.path.exists(os.path.join(dname, self.adminDir)): - # add directories recursively, if they aren't in the repository already + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) wdir = dname @@ -611,14 +640,17 @@ d = os.path.dirname(n) if self.__wcng: repodir = d - while not os.path.isdir(os.path.join(repodir, self.adminDir)): + while not os.path.isdir( + os.path.join(repodir, self.adminDir)): repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != os.path.normcase(repodir) and \ - (d not in tree2 + tree) and \ - (os.path.normcase(d) not in self.statusCache or \ - self.statusCache[os.path.normcase(d)] == self.canBeAdded): + while os.path.normcase(d) != \ + os.path.normcase(repodir) and \ + (d not in tree2 + tree) and \ + (os.path.normcase(d) not in self.statusCache or \ + self.statusCache[os.path.normcase(d)] == \ + self.canBeAdded): tree2.append(d) d = os.path.dirname(d) else: @@ -637,7 +669,8 @@ self.startSynchronizedProcess(QProcess(), "svn", args, wdir) else: dia = SvnDialog( - self.trUtf8('Adding files/directories to the Subversion repository')) + self.trUtf8('Adding files/directories to the Subversion' + ' repository')) res = dia.startProcess(args, wdir) if res: dia.exec_() @@ -654,9 +687,11 @@ def vcsAddTree(self, path): """ - Public method to add a directory tree rooted at path to the Subversion repository. + Public method to add a directory tree rooted at path to the Subversion + repository. - @param path root directory of the tree to be added (string or list of strings)) + @param path root directory of the tree to be added (string or list of + strings)) """ args = [] args.append('add') @@ -670,14 +705,17 @@ d = os.path.dirname(n) if self.__wcng: repodir = d - while not os.path.isdir(os.path.join(repodir, self.adminDir)): + while not os.path.isdir( + os.path.join(repodir, self.adminDir)): repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != os.path.normcase(repodir) and \ - (d not in tree) and \ - (os.path.normcase(d) not in self.statusCache or \ - self.statusCache[os.path.normcase(d)] == self.canBeAdded): + while os.path.normcase(d) != \ + os.path.normcase(repodir) and \ + (d not in tree) and \ + (os.path.normcase(d) not in self.statusCache or \ + self.statusCache[os.path.normcase(d)] == \ + self.canBeAdded): tree.append(d) d = os.path.dirname(d) else: @@ -697,10 +735,13 @@ repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(dname) != os.path.normcase(repodir) and \ - (os.path.normcase(dname) not in self.statusCache or \ - self.statusCache[os.path.normcase(dname)] == self.canBeAdded): - # add directories recursively, if they aren't in the repository already + while os.path.normcase(dname) != \ + os.path.normcase(repodir) and \ + (os.path.normcase(dname) not in self.statusCache or \ + self.statusCache[os.path.normcase(dname)] == \ + self.canBeAdded): + # add directories recursively, if they aren't in the + # repository already tree.insert(-1, dname) dname = os.path.dirname(dname) else: @@ -725,12 +766,15 @@ def vcsRemove(self, name, project=False, noDialog=False): """ - Public method used to remove a file/directory from the Subversion repository. + Public method used to remove a file/directory from the Subversion + repository. The default operation is to remove the local copy as well. - @param name file/directory name to be removed (string or list of strings)) - @param project flag indicating deletion of a project tree (boolean) (not needed) + @param name file/directory name to be removed (string or list of + strings)) + @param project flag indicating deletion of a project tree (boolean) + (not needed) @param noDialog flag indicating quiet operations @return flag indicating successfull operation (boolean) """ @@ -750,7 +794,8 @@ res = self.startSynchronizedProcess(QProcess(), "svn", args) else: dia = SvnDialog( - self.trUtf8('Removing files/directories from the Subversion repository')) + self.trUtf8('Removing files/directories from the Subversion' + ' repository')) res = dia.startProcess(args) if res: dia.exec_() @@ -852,8 +897,9 @@ Subversion repository. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. @param name file/directory name to be diffed (string) """ @@ -902,9 +948,10 @@ if reposURL is None: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The tag operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The tag operation""" + """ will be aborted""")) return if self.otherData["standardLayout"]: @@ -936,7 +983,8 @@ if tagOp in [1, 4]: url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) elif tagOp in [2, 8]: - url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag)) + url = '{0}/branches/{1}'.format( + reposRoot, urllib.parse.quote(tag)) else: url = self.__svnURL(tag) @@ -984,11 +1032,12 @@ project = e5App().getObject("Project") names = [project.getRelativePath(nam) for nam in names] if names[0]: - from UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog + from UI.DeleteFilesConfirmationDialog import \ + DeleteFilesConfirmationDialog dlg = DeleteFilesConfirmationDialog(self.parent(), self.trUtf8("Revert changes"), - self.trUtf8("Do you really want to revert all changes to these files" - " or directories?"), + self.trUtf8("Do you really want to revert all changes to" + " these files or directories?"), names) yes = dlg.exec_() == QDialog.Accepted else: @@ -1016,9 +1065,10 @@ if reposURL is None: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Error"), - self.trUtf8("""The URL of the project repository could not be""" - """ retrieved from the working copy. The switch operation will""" - """ be aborted""")) + self.trUtf8( + """The URL of the project repository could not be""" + """ retrieved from the working copy. The switch""" + """ operation will be aborted""")) return False if self.otherData["standardLayout"]: @@ -1051,7 +1101,8 @@ if tagType == 1: url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag)) elif tagType == 2: - url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag)) + url = '{0}/branches/{1}'.format( + reposRoot, urllib.parse.quote(tag)) elif tagType == 4: url = '{0}/trunk'.format(reposRoot) tn = 'HEAD' @@ -1090,8 +1141,8 @@ del opts[opts.index('--force')] from .SvnMergeDialog import SvnMergeDialog - dlg = SvnMergeDialog(self.mergeList[0], self.mergeList[1], self.mergeList[2], - force) + dlg = SvnMergeDialog( + self.mergeList[0], self.mergeList[1], self.mergeList[2], force) if dlg.exec_() == QDialog.Accepted: urlrev1, urlrev2, target, force = dlg.getParameters() else: @@ -1153,8 +1204,8 @@ """ Private method used to get the registered state of a file in the vcs. - This is the variant for subversion installations using the new working copy - meta-data format. + This is the variant for subversion installations using the new + working copy meta-data format. @param name filename to check (string) @return a combination of canBeCommited and canBeAdded @@ -1180,10 +1231,10 @@ def __vcsRegisteredState_wc(self, name): """ - Private method used to get the registered state of a file in the vcs. + Private method used to get the registered state of a file in the VCS. - This is the variant for subversion installations using the old working copy - meta-data format. + This is the variant for subversion installations using the old working + copy meta-data format. @param name filename to check (string) @return a combination of canBeCommited and canBeAdded @@ -1206,11 +1257,12 @@ def vcsAllRegisteredStates(self, names, dname, shortcut=True): """ - Public method used to get the registered states of a number of files in the vcs. + Public method used to get the registered states of a number of files + in the VCS. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files have been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files have been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1225,14 +1277,15 @@ def __vcsAllRegisteredStates_wcng(self, names, dname, shortcut=True): """ - Private method used to get the registered states of a number of files in the vcs. + Private method used to get the registered states of a number of files + in the VCS. - This is the variant for subversion installations using the new working copy - meta-data format. + This is the variant for subversion installations using the new working + copy meta-data format. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files has been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1270,8 +1323,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 line in output.splitlines(): if self.rx_status1.exactMatch(line): flags = str(self.rx_status1.cap(1)) @@ -1293,14 +1346,15 @@ def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True): """ - Private method used to get the registered states of a number of files in the vcs. + Private method used to get the registered states of a number of files + in the VCS. - This is the variant for subversion installations using the old working copy - meta-data format. + This is the variant for subversion installations using the old working + copy meta-data format. - <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named - directory has been scanned already. If so, it is assumed, that the states for - all files has been populated by the previous run. + <b>Note:</b> If a shortcut is to be taken, the code will only check, + if the named directory has been scanned already. If so, it is assumed, + that the states for all files has been populated by the previous run. @param names dictionary with all filenames to be checked as keys @param dname directory to check in (string) @@ -1335,8 +1389,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 line in output.splitlines(): if self.rx_status1.exactMatch(line): flags = self.rx_status1.cap(1) @@ -1485,7 +1539,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') entryFound = False commitFound = False for line in output.splitlines(): @@ -1507,10 +1562,11 @@ info['url'] = \ line.replace('<url>', '').replace('</url>', '') elif line.startswith('<author>'): - info['last-author'] = \ - line.replace('<author>', '').replace('</author>', '') + info['last-author'] = line.replace('<author>', '')\ + .replace('</author>', '') elif line.startswith('<date>'): - value = line.replace('<date>', '').replace('</date>', '') + value = line.replace('<date>', '')\ + .replace('</date>', '') date, time = value.split('T') info['committed-date'] = date info['committed-time'] = "{0}{1}".format( @@ -1536,13 +1592,14 @@ info['committed-time'], info['last-author']) - ############################################################################ + ########################################################################### ## Public Subversion specific methods are below. - ############################################################################ + ########################################################################### def svnGetReposName(self, path): """ - Public method used to retrieve the URL of the subversion repository path. + Public method used to retrieve the URL of the subversion repository + path. @param path local path to get the svn repository path for (string) @return string with the repository path URL @@ -1560,11 +1617,13 @@ 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 line in output.splitlines(): line = line.strip() if line.startswith('<url>'): - reposURL = line.replace('<url>', '').replace('</url>', '') + reposURL = line.replace('<url>', '')\ + .replace('</url>', '') return reposURL return "" @@ -1662,7 +1721,8 @@ if not propName: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Set Property"), - self.trUtf8("""You have to supply a property name. Aborting.""")) + self.trUtf8("""You have to supply a property name.""" + """ Aborting.""")) return args = [] @@ -1705,7 +1765,8 @@ if not propName: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Delete Property"), - self.trUtf8("""You have to supply a property name. Aborting.""")) + self.trUtf8("""You have to supply a property name.""" + """ Aborting.""")) return args = [] @@ -1753,8 +1814,8 @@ else: self.branchesList = [] allTagsBranchesList = None - self.tagbranchList.start(path, tags, - self.branchesList, self.allTagsBranchesList) + self.tagbranchList.start( + path, tags, self.branchesList, self.allTagsBranchesList) def svnBlame(self, name): """ @@ -1773,8 +1834,9 @@ Subversion repository. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. This method gives the chance to enter the revisions to be compared. @@ -1808,8 +1870,9 @@ repository URLs. If name is a directory and is the project directory, all project files - are saved first. If name is a file (or list of files), which is/are being edited - and has unsaved modification, they can be saved or the operation may be aborted. + are saved first. If name is a file (or list of files), which is/are + being edited and has unsaved modification, they can be saved or the + operation may be aborted. This method gives the chance to enter the revisions to be compared. @@ -1832,7 +1895,8 @@ dname = self.splitPath(names[0])[0] from .SvnUrlSelectionDialog import SvnUrlSelectionDialog - dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, dname) + dlg = SvnUrlSelectionDialog(self, self.tagsList, self.branchesList, + dname) if dlg.exec_() == QDialog.Accepted: urls, summary = dlg.getURLs() from .SvnDiffDialog import SvnDiffDialog @@ -1843,7 +1907,8 @@ def __svnGetFileForRevision(self, name, rev=""): """ - Private method to get a file for a specific revision from the repository. + Private method to get a file for a specific revision from the + repository. @param name file name to get from the repository (string) @keyparam rev revision to retrieve (integer or string) @@ -1872,7 +1937,8 @@ error = str(process.readAllStandardError(), Preferences.getSystem("IOEncoding"), 'replace') else: - error = self.trUtf8("The svn process did not finish within 30s.") + error = self.trUtf8( + "The svn process did not finish within 30s.") else: error = self.trUtf8('The process {0} could not be started. ' 'Ensure, that it is in the search path.').format('svn') @@ -1931,7 +1997,8 @@ except IOError: E5MessageBox.critical(self.__ui, self.trUtf8("Subversion Side-by-Side Difference"), - self.trUtf8("""<p>The file <b>{0}</b> could not be read.</p>""") + self.trUtf8( + """<p>The file <b>{0}</b> could not be read.</p>""") .format(name)) return @@ -1958,9 +2025,11 @@ """ Public method used to lock a file in the Subversion repository. - @param name file/directory name to be locked (string or list of strings) + @param name file/directory name to be locked (string or list of + strings) @param stealIt flag indicating a forced operation (boolean) - @param parent reference to the parent object of the subversion dialog (QWidget) + @param parent reference to the parent object of the subversion dialog + (QWidget) """ args = [] args.append('lock') @@ -1974,7 +2043,8 @@ dname, fname = self.splitPath(name) args.append(fname) - dia = SvnDialog(self.trUtf8('Locking in the Subversion repository'), parent) + dia = SvnDialog( + self.trUtf8('Locking in the Subversion repository'), parent) res = dia.startProcess(args, dname) if res: dia.exec_() @@ -1983,9 +2053,11 @@ """ Public method used to unlock a file in the Subversion repository. - @param name file/directory name to be unlocked (string or list of strings) + @param name file/directory name to be unlocked (string or list of + strings) @param breakIt flag indicating a forced operation (boolean) - @param parent reference to the parent object of the subversion dialog (QWidget) + @param parent reference to the parent object of the subversion dialog + (QWidget) """ args = [] args.append('unlock') @@ -1999,7 +2071,8 @@ dname, fname = self.splitPath(name) args.append(fname) - dia = SvnDialog(self.trUtf8('Unlocking in the Subversion repository'), parent) + dia = SvnDialog( + self.trUtf8('Unlocking in the Subversion repository'), parent) res = dia.startProcess(args, dname) if res: dia.exec_() @@ -2164,9 +2237,9 @@ return changelists - ############################################################################ + ########################################################################### ## Private Subversion specific methods are below. - ############################################################################ + ########################################################################### def __svnURL(self, url): """ @@ -2181,7 +2254,8 @@ scheme = url[0] host = url[1] port, path = url[2].split("/", 1) - return "{0}:{1}:{2}/{3}".format(scheme, host, port, urllib.parse.quote(path)) + return "{0}:{1}:{2}/{3}".format( + scheme, host, port, urllib.parse.quote(path)) else: scheme = url[0] if scheme == "file": @@ -2192,7 +2266,8 @@ except ValueError: host = url[1][2:] path = "" - return "{0}://{1}/{2}".format(scheme, host, urllib.parse.quote(path)) + return "{0}://{1}/{2}".format( + scheme, host, urllib.parse.quote(path)) def svnNormalizeURL(self, url): """ @@ -2213,22 +2288,25 @@ url = "/{0}".format(url) return "{0}://{1}".format(protocol, url) - ############################################################################ + ########################################################################### ## Methods to get the helper objects are below. - ############################################################################ + ########################################################################### - def vcsGetProjectBrowserHelper(self, browser, project, isTranslationsBrowser=False): + def vcsGetProjectBrowserHelper(self, browser, project, + isTranslationsBrowser=False): """ - Public method to instanciate a helper object for the different project browsers. + Public method to instanciate a helper object for the different + project browsers. @param browser reference to the project browser object @param project 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) @return the project browser helper object """ from .ProjectBrowserHelper import SvnProjectBrowserHelper - return SvnProjectBrowserHelper(self, browser, project, isTranslationsBrowser) + return SvnProjectBrowserHelper(self, browser, project, + isTranslationsBrowser) def vcsGetProjectHelper(self, project): """ @@ -2240,19 +2318,23 @@ helper = self.__plugin.getProjectHelper() helper.setObjects(self, project) self.__wcng = \ - os.path.exists(os.path.join(project.getProjectPath(), ".svn", "format")) or \ - os.path.exists(os.path.join(project.getProjectPath(), "_svn", "format")) + os.path.exists( + os.path.join(project.getProjectPath(), ".svn", "format")) or \ + os.path.exists( + os.path.join(project.getProjectPath(), "_svn", "format")) return helper - ############################################################################ + ########################################################################### ## Status Monitor Thread methods - ############################################################################ + ########################################################################### def _createStatusMonitorThread(self, interval, project): """ - Protected method to create an instance of the VCS status monitor thread. + Protected method to create an instance of the VCS status monitor + thread. - @param interval check interval for the monitor thread in seconds (integer) + @param interval check interval for the monitor thread in seconds + (integer) @param project reference to the project object @return reference to the monitor thread (QThread) """