|
1 # Copyright 2009 the Melange authors. |
|
2 # |
|
3 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 # you may not use this file except in compliance with the License. |
|
5 # You may obtain a copy of the License at |
|
6 # |
|
7 # http://www.apache.org/licenses/LICENSE-2.0 |
|
8 # |
|
9 # Unless required by applicable law or agreed to in writing, software |
|
10 # distributed under the License is distributed on an "AS IS" BASIS, |
|
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 # See the License for the specific language governing permissions and |
|
13 # limitations under the License. |
|
14 |
|
15 """Module containing the GHOP Callback. |
|
16 """ |
|
17 |
|
18 __authors__ = [ |
|
19 '"Madhusudan C.S." <madhusudancs@gmail.com>', |
|
20 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
21 ] |
|
22 |
|
23 |
|
24 class Callback(object): |
|
25 """Callback object that handles interaction between the core. |
|
26 """ |
|
27 |
|
28 API_VERSION = 1 |
|
29 |
|
30 def __init__(self, core): |
|
31 """Initializes a new Callback object for the specified core. |
|
32 """ |
|
33 |
|
34 self.core = core |
|
35 |
|
36 def registerWithSitemap(self): |
|
37 """Called by the server when sitemap entries should be registered. |
|
38 """ |
|
39 |
|
40 self.core.requireUniqueService('registerWithSitemap') |
|
41 |
|
42 def registerWithSidebar(self): |
|
43 """Called by the server when sidebar entries should be registered. |
|
44 """ |
|
45 |
|
46 # require that we had the chance to register the urls we need with the sitemap |
|
47 self.core.requireUniqueService('registerWithSidebar') |