- Timestamp:
- 07/03/08 13:01:01 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
platform/trac/plugins/wlwriter/trunk/wlwriter/atompub.py
r11204 r15083 4 4 import pkg_resources 5 5 6 # TODO: ページを取得後に画像を追加するとエラーになる。 7 # TODO: 新規の投稿と、開いてからの投稿で、メソッドがちがう?レスポンスが違う? 8 # TODO: 添付ファイルに対する HEAD メソッドは何を意味する? 9 # TODO: ページ取得時のレスポンスに鍵がありそう。 6 10 7 11 try: … … 40 44 """ 41 45 42 def atompub_get_feed(self,req,id ,need_location=False):43 """ 44 return data 46 def atompub_get_feed(self,req,id): 47 """ 48 return data,location 45 49 """ 46 50 def atompub_get_feedlist(req): … … 81 85 def _attachment(self, req, pagename=None,username=None,filename=None,realm='wiki',put_flag=True): 82 86 username = req.authname 83 if pagename == None :87 if pagename == None or pagename == '': 84 88 pagename = self._getTempPage(username,realm) 85 89 86 page = WikiPage(self.env, pagename )90 page = WikiPage(self.env, pagename, version=None) 87 91 if put_flag == True: 88 92 if filename == None: … … 122 126 entry= { 'id':page.name, 123 127 'title':page.name, 124 'author': page.author,128 'author':'hoge', 125 129 'updated':format_datetime(page.time,'iso8601'), 126 130 'src':req.abs_href('raw-attachment','wiki', page.name, filename), #req.href.attachment('%s/%s/%s'%(realm,page.name,filename)), … … 208 212 return """ 209 213 <atom:title>Wiki</atom:title> 214 <accept>image/*</accept> 210 215 <accept>application/atom+xml;type=entry</accept> 211 <accept>image/png</accept>212 <accept>image/jpeg</accept>213 <accept>image/gif</accept>214 216 <categories fixed="no"/> 215 217 """ … … 277 279 'service_post_url':req.abs_href.atompub('post'), 278 280 'service_feed_url':req.abs_href.atompub('feed'), 279 'service_upload_url':req.abs_href.atompub(' upload'),281 'service_upload_url':req.abs_href.atompub('login/wiki/feed'), 280 282 'title':'title:hoge', 281 283 'author':'', … … 374 376 375 377 # LocationをつけないとPostできないがつけると、Broken Pipeになる 376 location_header = None377 if need_location==True:378 location_header= req.abs_href.atompub('login/wiki/edit/%s'%(unicode_quote(to_unicode(page.name))))378 #location_header = None 379 #if need_location==True: 380 location_header= req.abs_href.atompub('login/wiki/edit/%s'%(unicode_quote(to_unicode(page.name)))) 379 381 380 382 return data,location_header … … 494 496 495 497 # LocationをつけないとPostできないがつけると、Broken Pipeになる 496 location_header = None497 if need_location==True:498 location_header= req.abs_href.atompub('login/wiki/edit/%s'%(unicode_quote(to_unicode(page.name))))498 #location_header = None 499 #if need_location==True: 500 location_header= req.abs_href.atompub('login/wiki/edit/%s'%(unicode_quote(to_unicode(page.name)))) 499 501 500 502 return data,location_header … … 579 581 return 'atom_feed.xml', provider.atompub_get_feedlist(req), 'text/xml' #'application/atom+xml' 580 582 581 elif action == 'attachment' :583 elif action == 'attachment' or action == 'edit_attachment': 582 584 return provider.atompub_do_update_attachment(req,id) 583 585
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)