Personal wiki notebook (not under development)

Notebook_rss.py 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import cgi
  2. from Rss_channel import Rss_channel
  3. from Rss_item import Rss_item
  4. class Notebook_rss( Rss_channel ):
  5. def __init__(
  6. self,
  7. user,
  8. rate_plan,
  9. notebooks,
  10. notebook,
  11. parent_id = None,
  12. login_url = None,
  13. logout_url = None,
  14. startup_notes = None,
  15. total_notes_count = None,
  16. notes = None,
  17. note_read_write = True,
  18. start = None,
  19. count = None,
  20. http_url = u"",
  21. conversion = None,
  22. rename = False,
  23. deleted_id = None,
  24. invites = None,
  25. invite_id = None,
  26. after_login = None,
  27. signup_plan = None,
  28. signup_yearly = None,
  29. recent_notes = None,
  30. groups = None,
  31. ):
  32. if notebook.name == u"Luminotes":
  33. notebook_path = u"/"
  34. elif notebook.name == u"Luminotes user guide":
  35. notebook_path = u"/guide"
  36. elif notebook.name == u"Luminotes blog":
  37. notebook_path = u"/blog"
  38. else:
  39. notebook_path = u"/notebooks/%s" % notebook.object_id
  40. notebook_path = http_url + notebook_path
  41. Rss_channel.__init__(
  42. self,
  43. notebook.name,
  44. notebook_path,
  45. notebook.name,
  46. [ Rss_item(
  47. title = cgi.escape( note.title ),
  48. link = u"%s?note_id=%s" % ( notebook_path, note.object_id ),
  49. description = cgi.escape( note.contents ),
  50. date = ( note.creation or note.revision ).strftime( "%Y-%m-%dT%H:%M:%SZ" ),
  51. guid = u"%s?note_id=%s" % ( notebook_path, note.object_id ),
  52. ) for note in recent_notes or notes ],
  53. )