Did some more string format conversions.

Tue, 27 Jul 2010 17:15:48 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 27 Jul 2010 17:15:48 +0200
changeset 417
459855d3066e
parent 416
9ca4a5979826
child 418
a13fe26c57a4

Did some more string format conversions.

Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/hg.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Tue Jul 27 17:15:48 2010 +0200
@@ -177,7 +177,7 @@
         @param name name (path) of the tag (string)
         """
         itm = QTreeWidgetItem(self.annotateList, 
-            [revision, changeset, author, date, "%d" % self.lineno, text])
+            [revision, changeset, author, date, "{0:d}".format(self.lineno), text])
         self.lineno += 1
         itm.setTextAlignment(0, Qt.AlignRight)
         itm.setTextAlignment(4, Qt.AlignRight)
--- a/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDiffDialog.py	Tue Jul 27 17:15:48 2010 +0200
@@ -255,7 +255,7 @@
             else:
                 dname, fname = self.vcs.splitPath(self.filename[0])
                 if fname != '.':
-                    fname = "%s.diff" % self.filename[0]
+                    fname = "{0}.diff".format(self.filename[0])
                 else:
                     fname = dname
         else:
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Tue Jul 27 17:15:48 2010 +0200
@@ -952,7 +952,7 @@
                 fieldIndex = self.RevisionColumn
                 txt = self.rxEdit.text()
                 if txt.startswith("^"):
-                    searchRx = QRegExp("^\s*%s" % txt[1:], Qt.CaseInsensitive)
+                    searchRx = QRegExp("^\s*{0}".format(txt[1:]), Qt.CaseInsensitive)
                 else:
                     searchRx = QRegExp(txt, Qt.CaseInsensitive)
             else:
--- a/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py	Tue Jul 27 17:15:48 2010 +0200
@@ -105,9 +105,9 @@
         scheme = self.protocolCombo.currentText()
         url = self.vcsUrlEdit.text()
         if scheme == "file://" and url[0] not in ["\\", "/"]:
-            url = "/%s" % url
+            url = "/{0}".format(url)
         vcsdatadict = {
-            "url" : '%s%s' % (scheme, url),
+            "url" : '{0}{1}'.format(scheme, url),
             "revision" : self.vcsRevisionEdit.text(), 
         }
         return (self.vcsProjectDirEdit.text(), vcsdatadict)
--- a/Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgStatusMonitorThread.py	Tue Jul 27 17:15:48 2010 +0200
@@ -96,12 +96,12 @@
                 for name in states:
                     try:
                         if self.reportedStates[name] != states[name]:
-                            self.statusList.append("%s %s" % (states[name], name))
+                            self.statusList.append("{0} {1}".format(states[name], name))
                     except KeyError:
-                        self.statusList.append("%s %s" % (states[name], name))
+                        self.statusList.append("{0} {1}".format(states[name], name))
                 for name in self.reportedStates.keys():
                     if name not in states:
-                        self.statusList.append("  %s" % name)
+                        self.statusList.append("  {0}".format(name))
                 self.reportedStates = states
                 return True, \
                        self.trUtf8("Mercurial status checked successfully")
--- a/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Jul 27 12:58:35 2010 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/hg.py	Tue Jul 27 17:15:48 2010 +0200
@@ -264,9 +264,9 @@
             rev = None
         vcsUrl = self.hgNormalizeURL(vcsDataDict["url"])
         if vcsUrl.startswith('/'):
-            vcsUrl = 'file://%s' % vcsUrl
+            vcsUrl = 'file://{0}'.format(vcsUrl)
         elif vcsUrl[1] in ['|', ':']:
-            vcsUrl = 'file:///%s' % vcsUrl
+            vcsUrl = 'file:///{0}'.format(vcsUrl)
         
         args = []
         args.append('clone')
@@ -1090,19 +1090,20 @@
             user = url[1]
             host = url[2]
             port, path = url[3].split("/",1)
-            return "%s:%s:%s:%s/%s" % (scheme, user, host, port, urllib.parse.quote(path))
+            return "{0}:{1}:{2}:{3}/{4}".format(
+                scheme, user, host, port, urllib.parse.quote(path))
         elif len(url) == 3:
             scheme = url[0]
             host = url[1]
             port, path = url[2].split("/",1)
-            return "%s:%s:%s/%s" % (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":
-                return "%s:%s" % (scheme, urllib.parse.quote(url[1]))
+                return "{0}:{1}".format(scheme, urllib.parse.quote(url[1]))
             else:
                 host, path = url[1][2:].split("/",1)
-                return "%s://%s/%s" % (scheme, host, urllib.parse.quote(path))
+                return "{0}://{1}/{2}".format(scheme, host, urllib.parse.quote(path))
 
     def hgNormalizeURL(self, url):
         """
@@ -1115,7 +1116,7 @@
         if url.endswith('/'):
             url = url[:-1]
         urll = url.split('//')
-        return "%s//%s" % (urll[0], '/'.join(urll[1:]))
+        return "{0}//{1}".format(urll[0], '/'.join(urll[1:]))
     
     def hgCopy(self, name, project):
         """

eric ide

mercurial