comparison wikked/page.py @ 292:0b0f3486719c

More efficient invalidation of the cache when a page is edited. More efficient auto-reload. Remove `force_resolve` option from the web frontend.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 27 Sep 2014 22:49:15 -0700
parents 23e310dd1ff7
children 6bd9d44fc535
comparison
equal deleted inserted replaced
291:035c7a58e9aa 292:0b0f3486719c
28 28
29 class PageData(object): 29 class PageData(object):
30 def __init__(self): 30 def __init__(self):
31 self.url = None 31 self.url = None
32 self.path = None 32 self.path = None
33 self.cache_time = None
33 self.title = None 34 self.title = None
34 self.raw_text = None 35 self.raw_text = None
35 self.formatted_text = None 36 self.formatted_text = None
36 self.local_meta = None 37 self.local_meta = None
37 self.local_links = None 38 self.local_links = None
53 return self._data.url 54 return self._data.url
54 55
55 @property 56 @property
56 def path(self): 57 def path(self):
57 return self._data.path 58 return self._data.path
59
60 @property
61 def cache_time(self):
62 return self._data.cache_time
58 63
59 @property 64 @property
60 def extension(self): 65 def extension(self):
61 if self._data.path is None: 66 if self._data.path is None:
62 raise Exception("The 'path' field was not loaded.") 67 raise Exception("The 'path' field was not loaded.")
131 136
132 def _loadFromPageInfo(self, wiki, page_info): 137 def _loadFromPageInfo(self, wiki, page_info):
133 data = PageData() 138 data = PageData()
134 data.url = page_info.url 139 data.url = page_info.url
135 data.path = page_info.path 140 data.path = page_info.path
141 data.cache_time = None
136 data.raw_text = page_info.content 142 data.raw_text = page_info.content
137 143
138 # Format the page and get the meta properties. 144 # Format the page and get the meta properties.
139 ctx = FormattingContext(page_info.url) 145 ctx = FormattingContext(page_info.url)
140 f = PageFormatter() 146 f = PageFormatter()