comparison bitsyblog/bitsyblog.py @ 59:0af1f4ae328d

fix a couple of basic things
author egj@socialplanning.org
date Mon, 04 Jan 2010 03:12:04 +0000
parents b97d11e2cf41
children 94dddb3a5d77
comparison
equal deleted inserted replaced
58:b97d11e2cf41 59:0af1f4ae328d
3 this is the view class and is more bitsyblog than anything 3 this is the view class and is more bitsyblog than anything
4 else can claim to be 4 else can claim to be
5 """ 5 """
6 6
7 ### global variables 7 ### global variables
8
9 # who can view which blog posts
10 roles = { 'public': ( 'public', ),
11 'friend': ( 'public', 'secret' ),
12 'author': ( 'public', 'secret', 'private' ), }
13 8
14 ### imports 9 ### imports
15 10
16 import dateutil.parser 11 import dateutil.parser
17 12
33 from genshi.template import TemplateLoader 28 from genshi.template import TemplateLoader
34 from paste.fileapp import FileApp 29 from paste.fileapp import FileApp
35 from pkg_resources import resource_filename 30 from pkg_resources import resource_filename
36 from StringIO import StringIO 31 from StringIO import StringIO
37 from urlparse import urlparse 32 from urlparse import urlparse
38 from user import FilespaceUsers
39 from webob import Request, Response, exc 33 from webob import Request, Response, exc
34
35 from roles import roles
40 36
41 ### exceptions 37 ### exceptions
42 38
43 class BlogPathException(Exception): 39 class BlogPathException(Exception):
44 """exception when trying to retrieve the blog""" 40 """exception when trying to retrieve the blog"""
72 'POST': self.post, 68 'POST': self.post,
73 'PUT': self.put 69 'PUT': self.put
74 } 70 }
75 71
76 # abstract attributes 72 # abstract attributes
73 from user import FilespaceUsers
74
77 self.users = FilespaceUsers(self.file_dir) 75 self.users = FilespaceUsers(self.file_dir)
78 self.blog = FileBlog(self.file_dir) 76 self.blog = FileBlog(self.file_dir)
79 self.cooker = self.restructuredText 77 self.cooker = self.restructuredText
80 self.feed_items = int(self.feed_items) 78 self.feed_items = int(self.feed_items)
81 79