[gnome-ostree/wip/simple-cleanups: 2/19] supybot: Replace string concatenation with string formatting



commit 54b006ff58ca8b9653315983de15e2556f669ff6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jun 13 13:40:59 2013 -0400

    supybot: Replace string concatenation with string formatting

 extras/supybot/GNOMEOSTree/plugin.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/extras/supybot/GNOMEOSTree/plugin.py b/extras/supybot/GNOMEOSTree/plugin.py
index be4539d..f1721fb 100644
--- a/extras/supybot/GNOMEOSTree/plugin.py
+++ b/extras/supybot/GNOMEOSTree/plugin.py
@@ -45,7 +45,7 @@ class GNOMEOSTree(callbacks.Plugin):
         self._last_task_versions = {}
         tracked_build = 'buildmaster'
         self._workdir = os.path.expanduser('/srv/ostree/ostbuild/%s/' % (tracked_build, ))
-        self._workurl = "http://build.gnome.org/ostree/%s/"; % (tracked_build, )
+        self._workurl = "http://build.gnome.org/ostree/%s"; % (tracked_build, )
 
     def _broadcast(self, msg):
         for channel in self._irc.state.channels:
@@ -56,11 +56,11 @@ class GNOMEOSTree(callbacks.Plugin):
             self._query_new_task(taskname, status=status)
 
     def _query_new_task(self, taskname, status=False):
-        current_task_path = os.path.join(self._workdir, 'tasks/' + taskname + '/current')
+        current_task_path = os.path.join(self._workdir, 'tasks/%s/current' % (taskname,))
         meta_path = os.path.join(current_task_path, 'meta.json')
         if not os.path.exists(meta_path):
             if status:
-                self._broadcast("No current " + taskname + " completed")
+                self._broadcast("No current %s completed" % (taskname,))
             return
 
         f = open(meta_path)
@@ -76,9 +76,9 @@ class GNOMEOSTree(callbacks.Plugin):
 
         self._last_task_versions[taskname] = taskver
         if (not status and not version_unchanged):
-            msg = "New " + taskname
+            msg = "New %s" % (taskname,)
         else:
-            msg = "Current " + taskname
+            msg = "Current %s" % (taskname,)
         success = metadata['success']
         success_str = success and 'successful' or 'failed'
         millis = float(metadata['elapsedMillis'])
@@ -91,7 +91,7 @@ class GNOMEOSTree(callbacks.Plugin):
             f.close()
             msg += status_msg + ' '
 
-        msg += self._workurl + "tasks/" + taskname + "/%s/%s/output.txt" % (success_str, taskver)
+        msg += "%s/tasks/%s/%s/%s/output.txt" % (self._workurl, taskname, success_str, taskver)
 
         if not success:
             msg = ircutils.mircColor(msg, fg='red')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]