[telepathy-ashes/master] misc

David Laban david.laban at collabora.co.uk
Thu Nov 12 03:14:24 PST 2009


changed formatting on !version
added string processing helper function
Remove pointless debugging statement in media_echoer
---
 ashes/tools/commands.py         |    4 ++--
 ashes/tools/helper_functions.py |    7 +++++++
 ashes/tools/media_echoer.py     |    1 -
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ashes/tools/commands.py b/ashes/tools/commands.py
index d8e0588..cb60eae 100644
--- a/ashes/tools/commands.py
+++ b/ashes/tools/commands.py
@@ -121,8 +121,8 @@ class CommandExecutor(TextChannelEchoer):
             ret.append("I'm afraid I can't tell you what version of the CM "
                 "I was launched with, because I wasn't given that information.")
         if git_url and git_revision:
-            ret.append("My source can be found at %s" % git_url)
-            ret.append("git revision: %s" % git_revision)
+            ret.append("My source can be found at %s git revision: %s"
+                % (git_url, git_revision))
 
 
         if other_versions:
diff --git a/ashes/tools/helper_functions.py b/ashes/tools/helper_functions.py
index 778e94e..d7cd119 100644
--- a/ashes/tools/helper_functions.py
+++ b/ashes/tools/helper_functions.py
@@ -89,6 +89,13 @@ def rpartial(function, *stored_args, **stored_kwargs):
     return do
 
 
+def between(string, start, stop):
+    """Returns the smallest string bounded by start and stop.
+    Think string.between(start, stop)."""
+    string = string[string.rindex(start)+len(start):]
+    string = string[:string.index(stop)]
+    return string
+
 def green(string):
     """For making things green when you print them in a terminal"""
     return '\033[0;32;40m'+string+'\033[0m'
diff --git a/ashes/tools/media_echoer.py b/ashes/tools/media_echoer.py
index 638b106..1e2ac22 100644
--- a/ashes/tools/media_echoer.py
+++ b/ashes/tools/media_echoer.py
@@ -125,7 +125,6 @@ class MediaChannelEchoer(MemberAcceptor):
     def Closed(self):
         # FIXME: work out why there is a "loop detected in the graph of bin
         # pipeline0!!", and why that's causing async_handler to stay alive.
-        gst.xml_write_file(self.pipeline, open('pipeline.xml', 'w'))
         gobject.source_remove(self.watch_id)
         bus = self.pipeline.get_bus().remove_signal_watch()
         self.pipeline.set_state(gst.STATE_NULL)
-- 
1.5.6.5




More information about the telepathy-commits mailing list