Changeset 1424
- Timestamp:
- 06/28/08 08:09:58 (5 months ago)
- Location:
- trunk/peppy
- Files:
-
- 2 added
- 2 modified
-
fundamental.py (modified) (2 diffs)
-
plugins/project.peppy-plugin (added)
-
plugins/project.py (added)
-
stcbase.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/fundamental.py
r1399 r1424 198 198 199 199 self.spell = None 200 201 self.applyTemplate() 200 202 201 203 self.applySettings() … … 290 292 if self.spell and self.spell.hasDictionary(): 291 293 self.status_info.addIcon("icons/book_open.png", "Dictionary available for %s" % self.spell.getLanguage()) 294 295 def applyTemplate(self): 296 """Attempt to load a template when encountering a zero length file 297 298 """ 299 if self.GetLength() == 0: 300 info = dict(url=self.buffer.url, mode=self, templates=list()) 301 Publisher().sendMessage('template.find', info) 302 dprint(info) 303 304 # templates is a list, where each element is a tuple consisting of 305 # the sort order and the template 306 sorted = info['templates'] 307 sorted.sort(key=lambda x:x[0]) 308 dprint(sorted) 309 if len(sorted) > 0: 310 template = sorted[0][1] 311 self.resetText(template) 292 312 293 313 def applySettings(self): -
trunk/peppy/stcbase.py
r1415 r1424 206 206 def openSuccess(self, buffer, headersize=1024, encoding=None): 207 207 bytes = self.tempstore.getvalue() 208 209 self.resetText(bytes, headersize, encoding) 210 211 del self.tempstore 212 213 def resetText(self, bytes, headersize=1024, encoding=None): 208 214 numbytes = len(bytes) 209 215 if headersize > numbytes: … … 218 224 self.decodeText(bytes) 219 225 assert self.dprint("found encoding = %s" % self.refstc.encoding) 220 221 del self.tempstore222 226 223 227 def readFrom(self, fh, amount=None, chunk=65536, length=0, message=None):
