From 00271e7c4d6f94e54c5c0217baf7170eacbcc1d3 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Mon, 5 May 2008 22:16:51 -0400 Subject: [PATCH] Allow entering a search string to search in some specific field. I am looking for ':' in the string to determine if I want to feed the string straight to the command parser, or do some intervening. This is probably not the best way of doing it, but it's good enough for now! --- example/xmms/xmms_search.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/xmms/xmms_search.py b/example/xmms/xmms_search.py index 54b7b5e..b7a2f64 100755 --- a/example/xmms/xmms_search.py +++ b/example/xmms/xmms_search.py @@ -76,7 +76,12 @@ class XSearch(gnt.Box): def search(self, entry): self.list.remove_all() string = entry.get_text() - coll = xmmsclient.xmmsapi.coll_parse("artist:*%s* OR title:*%s*" % (string, string)) + searchstring = "" + if ':' in string: + searchstring = string + else: + searchstring = "artist:*%s* OR title:*%s*" % (string, string) + coll = xmmsclient.xmmsapi.coll_parse(searchstring) def got_coll_list(result): self.list.remove_all() songs = result.value() -- 2.11.4.GIT