Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(658)

Unified Diff: chrome/common/extensions/docs/server2/data_source.py

Issue 22824042: Docserver: SidenavDataSource refactor, transition to DataSourceRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/data_source.py
diff --git a/chrome/common/extensions/docs/server2/data_source.py b/chrome/common/extensions/docs/server2/data_source.py
index 3e1676e78a24fddd276bf5376650b1a803f7985e..c31cd4887662c36b684e65f0b86cb5c0412ddeaf 100644
--- a/chrome/common/extensions/docs/server2/data_source.py
+++ b/chrome/common/extensions/docs/server2/data_source.py
@@ -8,16 +8,20 @@ class DataSource(object):
Defines an abstraction for all DataSources.
DataSources must have two public methods, get and Cron. A DataSource is
- initialized with a ServerInstance. Anything in the ServerInstance can be used
- by the DataSource.
+ initialized with a ServerInstance and a Request (defined in servlet.py).
+ Anything in the ServerInstance can be used by the DataSource. Request is None
+ when DataSources are created for Cron.
DataSources are used to provide templates with access to data. DataSources may
not access other DataSources and any logic or data that is useful to other
DataSources must be moved to a different class.
'''
+ def __init__(self, server_instance, request):
+ pass
+
def Cron(self):
'''Must cache all files needed by |get| to persist them. Called on a live
- file system and can access files not in cache.
+ file system and can access files not in cache. |request| will be None.
'''
raise NotImplementedError(self.__class__)

Powered by Google App Engine
This is Rietveld 408576698