r6849 - bigboard/trunk/bigboard
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r6849 - bigboard/trunk/bigboard
- Date: Mon, 29 Oct 2007 14:49:10 -0500 (CDT)
Author: hp
Date: 2007-10-29 14:49:03 -0500 (Mon, 29 Oct 2007)
New Revision: 6849
Modified:
bigboard/trunk/bigboard/search.py
Log:
s/Error/Exception/
Modified: bigboard/trunk/bigboard/search.py
===================================================================
--- bigboard/trunk/bigboard/search.py 2007-10-29 18:20:43 UTC (rev 6848)
+++ bigboard/trunk/bigboard/search.py 2007-10-29 19:49:03 UTC (rev 6849)
@@ -36,7 +36,7 @@
def _on_activated(self):
"""Action when user has activated the result"""
- raise Error("No activation action implemented for search result")
+ raise Exception("No activation action implemented for search result")
class SearchProvider(object):
"""An object that can provide SearchResult given a search string"""
@@ -53,11 +53,11 @@
def get_heading(self):
"""The human-readable heading to be displayed above search results from this provider"""
- raise Error("get_heading() method not implemented on SearchProvider %s" % id)
+ raise Exception("get_heading() method not implemented on SearchProvider %s" % id)
def perform_search(self, query, consumer):
"""Performs a search and calls add_results() on the consumer as they arrive"""
- raise Error("perform_search() not implemented on SearchProvider %s" % id)
+ raise Exception("perform_search() not implemented on SearchProvider %s" % id)
class SearchConsumer(object):
"""An object that hears back about search results"""
@@ -86,7 +86,7 @@
This is optional, if your search provider is global; if it's per-stock you can
also provide a constructor to enable_search_provider()."""
if id in __constructors:
- raise Error("Already registered search provider constructor %s " % id)
+ raise Exception("Already registered search provider constructor %s " % id)
__constructors[id] = constructor
@@ -98,7 +98,7 @@
if id in __constructors:
constructor = __constructors[id]
if not constructor:
- raise Error("No search provider constructor registered or provided for %s" % id)
+ raise Exception("No search provider constructor registered or provided for %s" % id)
if id in __enabled_counts:
__enabled_counts[id] = __enabled_counts[id] + 1
@@ -112,10 +112,10 @@
__enabled_counts[id] = __enabled_counts[id] - 1
if __enabled_counts[id] == 0:
if id not in __providers:
- raise Error("Disabled search provider %s was not present" % id)
+ raise Exception("Disabled search provider %s was not present" % id)
del __providers[id]
else:
- raise Error("Search provider %s disabled but not enabled" % id)
+ raise Exception("Search provider %s disabled but not enabled" % id)
def perform_search(query, consumer):
"""Clear results on consumer, ask all enabled providers to run the given search, and add the results to the consumer"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]