Changeset 319 in products for SimpleBlog/branches/plone-2.1-Blogging-APIs/Blog.py
- Timestamp:
- Apr 12, 2006 3:24:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SimpleBlog/branches/plone-2.1-Blogging-APIs/Blog.py
r211 r319 6 6 import Permissions 7 7 from Products.CMFCore.utils import getToolByName 8 9 import MetaWeblogAPI 10 import BloggerAPI 11 import MovableTypeAPI 12 8 13 9 14 schema = BaseFolderSchema + Schema(( … … 96 101 condition="python:0", # this line have to be removed in order to be visible/editable 97 102 description="Enter administrator's email for receaving notification about blog's activity"), 98 ) 103 ), 104 BooleanField('allowDelicious', 105 default = 1, 106 accessor = 'isDeliciousEnabled', 107 schemata = 'interface', 108 widget=BooleanWidget(label="Turn Delicious bookmarklet", 109 label_msgid="label_allow_delicious", 110 description_msgid="help_allow_delicious"), 111 ), 112 BooleanField('allowDigg', 113 default = 1, 114 accessor = 'isDiggEnabled', 115 schemata = 'interface', 116 widget=BooleanWidget(label="Turn Digg bookmarklet", 117 label_msgid="label_allow_digg", 118 description_msgid="help_allow_digg"), 119 ), 120 BooleanField('allowYahoo', 121 default = 1, 122 accessor = 'isYahooEnabled', 123 schemata = 'interface', 124 widget=BooleanWidget(label="Turn Yahoo bookmarklet", 125 label_msgid="label_allow_yahoo", 126 description_msgid="help_allow_yahoo"), 127 ), 128 BooleanField('allowGoogle', 129 default = 1, 130 accessor = 'isGoogleEnabled', 131 schemata = 'interface', 132 widget=BooleanWidget(label="Turn Google bookmarklet", 133 label_msgid="label_allow_google", 134 description_msgid="help_allow_google"), 135 ), 136 BooleanField('allowSpurl', 137 default = 1, 138 accessor = 'isSpurlEnabled', 139 schemata = 'interface', 140 widget=BooleanWidget(label="Turn Spurl bookmarklet", 141 label_msgid="label_allow_spurl", 142 description_msgid="help_allow_spurl"), 143 ), 99 144 #BooleanField('allowComments', 100 145 # default = 1, … … 123 168 global_allow=1 124 169 schema=schema 170 171 blogger = None 172 metaWeblog = None 125 173 126 174 content_icon='simpleblog_icon.gif' … … 141 189 'visible':0}) 142 190 191 def initializeArchetype(self, **kwargs): 192 BaseFolder.initializeArchetype(self, **kwargs) 193 RPCAuth = self.simpleblog_tool.findRPCAuth(self) 194 195 # Setup the MetaWeblog API 196 self.metaWeblog = MetaWeblogAPI.MetaWeblogAPI().__of__(self) 197 self.metaWeblog.setupRPCAuth(RPCAuth) 198 199 # Setup the Blogger API 200 self.blogger = BloggerAPI.BloggerAPI().__of__(self) 201 self.blogger.setupRPCAuth(RPCAuth) 202 203 # Setup the MovableTypeAPI API 204 self.mt = MovableTypeAPI.MovableTypeAPI().__of__(self) 205 self.mt.setupRPCAuth(RPCAuth) 206 143 207 def manage_afterAdd(self, item, container): 144 208 BaseFolder.manage_afterAdd(self, item, container) … … 171 235 return val 172 236 237 def listCategories(self): 238 cats=self.getCategories() 239 240 # add the global categories 241 for c in self.simpleblog_tool.getGlobalCategories(): 242 if not c in cats: 243 cats.append(c) 244 cats = list(cats) 245 cats.sort() 246 return tuple(cats) 247 173 248 registerType(Blog) 174 249
Note: See TracChangeset
for help on using the changeset viewer.