~divmod-dev/divmod.org/NULLIFY-versus-disallowNone-2736

« back to all changes in this revision

Viewing changes to Mantissa/xmantissa/publicresource.py

  • Committer: glyph
  • Date: 2006-01-11 17:00:20 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:4021

Author: glyph
Reviewer: moe

Fixes #382

This merge provides basic sharing functionality, such as the ability to give a
user a publicly-viewable web page (at /by/username, for the cool kids, or
/users, if you're a fuddy-duddy).

It also adds (working) support for a simple ClickChronicle public page at
/by/username/clicks, which exposes the "my clicks" page without the "actions"
column, and also (not working) Hyperbola at /by/username/blog which should some
day soon grow into a blog.  Patches accepted :).


Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        return tag[livepage.glue]
76
76
 
77
77
class PublicAthenaLivePage(PublicPageMixin, athena.LivePage):
78
 
    def __init__(self, iface, original, fragment, staticContent, forUser):
79
 
        super(PublicAthenaLivePage, self).__init__(iface, original, docFactory=getLoader("public-shell"))
80
 
        self.fragment = fragment
 
78
    fragment = None
 
79
    def __init__(self, fragment, staticContent=None, forUser=None, *a, **k):
 
80
        super(PublicAthenaLivePage, self).__init__(
 
81
            docFactory=getLoader("public-shell"),
 
82
            *a, **k)
 
83
        if fragment is not None:
 
84
            self.fragment = fragment
 
85
            # everybody who calls this has a different idea of what 'fragment'
 
86
            # means - let's just be super-lenient for now
 
87
            if getattr(fragment, 'setFragmentParent', False):
 
88
                fragment.setFragmentParent(self)
 
89
            else:
 
90
                fragment.page = self
81
91
        self.staticContent = staticContent
82
92
        if forUser is not None:
83
93
            assert isinstance(forUser, unicode), forUser