Skip to content

Instantly share code, notes, and snippets.

@segphault
Created March 11, 2010 22:47
Show Gist options
  • Select an option

  • Save segphault/329778 to your computer and use it in GitHub Desktop.

Select an option

Save segphault/329778 to your computer and use it in GitHub Desktop.
=== modified file 'gwibber/gwui.py'
--- gwibber/gwui.py 2010-02-28 20:11:47 +0000
+++ gwibber/gwui.py 2010-03-11 22:42:11 +0000
@@ -190,10 +190,14 @@
for search in self.streams.get_records(COUCH_TYPE_SEARCH, True):
search = search.value
sId = search["_id"]
+
+ view = self.messages.execute_view("transient_time", "messages")[[sId, {}]:[sId, 0]]
+ view.search_query = search["query"]
+
searches["items"].append({
"name": search["name"],
"account": None,
- "view": self.messages.execute_view("transient_time", "messages")[[sId, {}]:[sId, 0]],
+ "view": view,
"stream": "search",
"transient": sId,
"color": None,
@@ -671,6 +675,8 @@
view.options["limit"] = 100
view._fetch()
+ search_query = view.search_query if hasattr(view, "search_query") else None
+
for item in view:
message = item.value
message["dupes"] = []
@@ -699,6 +705,7 @@
seen[message["txtid"]] = n
WebUi.render(self, self.model.settings["theme"], "template.mako",
+ search_query=search_query,
message_store=messages,
preferences=self.model.settings,
services=self.model.services,
=== modified file 'ui/templates/base.mako'
--- ui/templates/base.mako 2010-02-14 03:59:00 +0000
+++ ui/templates/base.mako 2010-03-11 22:44:35 +0000
@@ -196,6 +196,7 @@
</%def>
<%def name="messages(data)">
+ <p>Searched for: ${search_query}</p>
<div class="header">
</div>
<div class="messages">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment