AssistantEric/APIsManager.py

changeset 17
8f33c2f5bfbd
parent 4
eb4cc276920c
child 19
7eb775bb326b
diff -r 91e8b7cc6935 -r 8f33c2f5bfbd AssistantEric/APIsManager.py
--- a/AssistantEric/APIsManager.py	Sat Jul 24 18:33:43 2010 +0200
+++ b/AssistantEric/APIsManager.py	Fri Jul 30 18:53:11 2010 +0200
@@ -405,8 +405,8 @@
         SELECT format FROM mgmt
     """
     mgmt_insert_stmt = """
-        INSERT INTO mgmt (format) VALUES (%d)
-    """ % DB_VERSION
+        INSERT INTO mgmt (format) VALUES ({0:d})
+    """.format(DB_VERSION)
     
     def __init__(self, language, parent = None):
         """
@@ -416,7 +416,7 @@
         @param parent reference to the parent object (QObject)
         """
         QObject.__init__(self, parent)
-        self.setObjectName("DbAPIs_%s" % language)
+        self.setObjectName("DbAPIs_{0}".format(language))
         
         self.__inPreparation = False
         self.__worker = None
@@ -468,7 +468,7 @@
             apiDir = os.path.join(Utilities.getConfigDir(), "APIs")
             if not os.path.exists(apiDir):
                 os.makedirs(apiDir)
-            return os.path.join(apiDir, "%s-api.db" % self.__language)
+            return os.path.join(apiDir, "{0}-api.db".format(self.__language))
     
     def close(self):
         """
@@ -656,15 +656,15 @@
                     fullCtx = query.value(2)
                     if sig:
                         if self.__discardFirst:
-                            sig = "(%s" % sig[1:]\
+                            sig = "({0}".format(sig[1:])\
                                     .replace(self.__discardFirst, "", 1)\
                                     .strip(", \t\r\n")
                         if self.__enoughCommas(sig, commas):
                             if showContext:
-                                calltips.append("%s%s%s%s" % \
-                                    (fullCtx, contextSeparator, word, sig))
+                                calltips.append("{0}{1}{2}{3}".format(
+                                    fullCtx, contextSeparator, word, sig))
                             else:
-                                calltips.append("%s%s" % (word, sig))
+                                calltips.append("{0}{1}".format(word, sig))
                 del query
             finally:
                 db.commit()

eric ide

mercurial