예제 #1
0
  def __init__(
    self,
    user,
    notebooks,
    first_notebook,
    login_url,
    logout_url,
    rate_plan,
    groups,
    forum_name,
    threads,
    total_thread_count,
    start = 0,
    count = None,
  ):
    forum_path = cherrypy.request.base + cherrypy.request.path
    if forum_name == u"blog":
      full_forum_name = u"Luminotes %s" % forum_name
    else:
      full_forum_name = u"%s forum" % forum_name

    Rss_channel.__init__(
      self,
      full_forum_name,
      forum_path,
      full_forum_name,
      [ Rss_item(
        title = cgi.escape( thread.name ),
        link = os.path.join( forum_path, ( forum_name == u"blog" ) and thread.friendly_id or thread.object_id ),
        description = cgi.escape( thread.name ),
        date = thread.revision.strftime( "%Y-%m-%dT%H:%M:%SZ" ),
        guid = os.path.join( forum_path, ( forum_name == u"blog" ) and thread.friendly_id or thread.object_id ),
      ) for thread in threads ],
    )
예제 #2
0
    def __init__(
        self,
        user,
        rate_plan,
        notebooks,
        notebook,
        parent_id=None,
        login_url=None,
        logout_url=None,
        startup_notes=None,
        total_notes_count=None,
        notes=None,
        note_read_write=True,
        start=None,
        count=None,
        http_url=u"",
        conversion=None,
        rename=False,
        deleted_id=None,
        invites=None,
        invite_id=None,
        after_login=None,
        signup_plan=None,
        signup_yearly=None,
        recent_notes=None,
        groups=None,
    ):
        if notebook.name == u"Luminotes":
            notebook_path = u"/"
        elif notebook.name == u"Luminotes user guide":
            notebook_path = u"/guide"
        elif notebook.name == u"Luminotes blog":
            notebook_path = u"/blog"
        else:
            notebook_path = u"/notebooks/%s" % notebook.object_id

        notebook_path = http_url + notebook_path

        Rss_channel.__init__(
            self,
            notebook.name,
            notebook_path,
            notebook.name,
            [
                Rss_item(
                    title=cgi.escape(note.title),
                    link=u"%s?note_id=%s" % (notebook_path, note.object_id),
                    description=cgi.escape(note.contents),
                    date=(note.creation
                          or note.revision).strftime("%Y-%m-%dT%H:%M:%SZ"),
                    guid=u"%s?note_id=%s" % (notebook_path, note.object_id),
                ) for note in recent_notes or notes
            ],
        )
예제 #3
0
  def __init__(
    self,
    user,
    rate_plan,
    notebooks,
    notebook,
    parent_id = None,
    login_url = None,
    logout_url = None,
    startup_notes = None,
    total_notes_count = None,
    notes = None,
    note_read_write = True,
    start = None,
    count = None,
    http_url = u"",
    conversion = None,
    rename = False,
    deleted_id = None,
    invites = None,
    invite_id = None,
    after_login = None,
    signup_plan = None,
    signup_yearly = None,
    recent_notes = None,
    groups = None,
  ):
    if notebook.name == u"Luminotes":
      notebook_path = u"/"
    elif notebook.name == u"Luminotes user guide":
      notebook_path = u"/guide"
    elif notebook.name == u"Luminotes blog":
      notebook_path = u"/blog"
    else:
      notebook_path = u"/notebooks/%s" % notebook.object_id

    notebook_path = http_url + notebook_path

    Rss_channel.__init__(
      self,
      notebook.name,
      notebook_path,
      notebook.name,
      [ Rss_item(
        title = cgi.escape( note.title ),
        link = u"%s?note_id=%s" % ( notebook_path, note.object_id ),
        description = cgi.escape( note.contents ),
        date = ( note.creation or note.revision ).strftime( "%Y-%m-%dT%H:%M:%SZ" ),
        guid = u"%s?note_id=%s" % ( notebook_path, note.object_id ),
      ) for note in recent_notes or notes ],
    )
예제 #4
0
    def __init__(
        self,
        recent_notes,
        notebook_id,
        notebook_name,
        https_url,
    ):
        if notebook_name == u"Luminotes":
            notebook_path = u"/"
        elif notebook_name == u"Luminotes user guide":
            notebook_path = u"/guide"
        elif notebook_name == u"Luminotes blog":
            notebook_path = u"/blog"
        else:
            notebook_path = u"/notebooks/%s" % notebook_id

        notebook_path = https_url + notebook_path

        Rss_channel.__init__(
            self,
            cgi.escape(notebook_name),
            notebook_path,
            u"Luminotes notebook",
            recent_notes and [
                Rss_item(
                    title=u"Note updated",
                    link=self.note_link(notebook_id, notebook_name, note_id,
                                        revision, https_url),
                    description=cgi.escape(
                        u'A note in <a href="%s">this notebook</a> has been updated. <a href="%s?note_id=%s">View the note.</a>'
                        % (notebook_path, notebook_path, note_id)),
                    date=revision.strftime("%Y-%m-%dT%H:%M:%SZ"),
                    guid=self.note_link(notebook_id, notebook_name, note_id,
                                        revision, https_url),
                ) for (note_id, revision) in recent_notes
            ] or [
                Rss_item(
                    title=u"Unknown notebook",
                    link=None,
                    description=cgi.escape(
                        u'Sorry, that notebook is unknown.'),
                    date=None,
                    guid=None,
                )
            ],
        )
예제 #5
0
    def __init__(
        self,
        user,
        notebooks,
        first_notebook,
        login_url,
        logout_url,
        rate_plan,
        groups,
        forum_name,
        threads,
        total_thread_count,
        start=0,
        count=None,
    ):
        forum_path = cherrypy.request.base + cherrypy.request.path
        if forum_name == u"blog":
            full_forum_name = u"Luminotes %s" % forum_name
        else:
            full_forum_name = u"%s forum" % forum_name

        Rss_channel.__init__(
            self,
            full_forum_name,
            forum_path,
            full_forum_name,
            [
                Rss_item(
                    title=cgi.escape(thread.name),
                    link=os.path.join(
                        forum_path,
                        (forum_name == u"blog") and thread.friendly_id
                        or thread.object_id),
                    description=cgi.escape(thread.name),
                    date=thread.revision.strftime("%Y-%m-%dT%H:%M:%SZ"),
                    guid=os.path.join(
                        forum_path,
                        (forum_name == u"blog") and thread.friendly_id
                        or thread.object_id),
                ) for thread in threads
            ],
        )
예제 #6
0
  def __init__(
    self,
    recent_notes,
    notebook_id,
    notebook_name,
    https_url,
  ):
    if notebook_name == u"Luminotes":
      notebook_path = u"/"
    elif notebook_name == u"Luminotes user guide":
      notebook_path = u"/guide"
    elif notebook_name == u"Luminotes blog":
      notebook_path = u"/blog"
    else:
      notebook_path = u"/notebooks/%s" % notebook_id

    notebook_path = https_url + notebook_path

    Rss_channel.__init__(
      self,
      cgi.escape( notebook_name ),
      notebook_path,
      u"Luminotes notebook",
      recent_notes and [ Rss_item(
        title = u"Note updated",
        link = self.note_link( notebook_id, notebook_name, note_id, revision, https_url ),
        description = cgi.escape( u'A note in <a href="%s">this notebook</a> has been updated. <a href="%s?note_id=%s">View the note.</a>' % ( notebook_path, notebook_path, note_id ) ),
        date = revision.strftime( "%Y-%m-%dT%H:%M:%SZ" ),
        guid = self.note_link( notebook_id, notebook_name, note_id, revision, https_url ),
      ) for ( note_id, revision ) in recent_notes ] or [ Rss_item(
        title = u"Unknown notebook",
        link = None,
        description = cgi.escape( u'Sorry, that notebook is unknown.' ),
        date = None,
        guid = None,
      ) ],
    )