Esempio n. 1
0
 def test_getLoaderCaching(self):
     """
     getLoader should return identical loaders for equal arguments.
     """
     self.assertIdentical(webtheme.getLoader('template'),
                          webtheme.getLoader('template'))
     self.assertEqual(self.gATcalled, 1)
Esempio n. 2
0
 def test_getLoaderCaching(self):
     """
     getLoader should return identical loaders for equal arguments.
     """
     self.assertIdentical(webtheme.getLoader('template'),
                          webtheme.getLoader('template'))
     self.assertEqual(self.gATcalled, 1)
Esempio n. 3
0
    def __init__(self, store):
        ScrollingFragment.__init__(self, store, POP3Grabber, None, [
            POP3Grabber.username, POP3Grabber.domain, POP3Grabber.paused,
            StatusColumn(POP3Grabber.status, self)
        ])

        self.docFactory = webtheme.getLoader(self.fragmentName)
Esempio n. 4
0
    def fragments(self, req, tag):
        """
        Render our preference collection, any child preference
        collections we discover by looking at self.tab.children,
        and any fragments returned by its C{getSections} method.

        Subtabs and C{getSections} fragments are rendered as fieldsets
        inside the parent preference collection's tab.
        """
        f = self._collectionToLiveform()
        if f is not None:
            yield tags.fieldset[tags.legend[self.tab.name], f]

        for t in self.tab.children:
            f = inevow.IRenderer(self.collection.store.getItemByID(t.storeID))
            f.tab = t
            if hasattr(f, 'setFragmentParent'):
                f.setFragmentParent(self)
            yield f

        for f in self.collection.getSections() or ():
            f = ixmantissa.INavigableFragment(f)
            f.setFragmentParent(self)
            f.docFactory = getLoader(f.fragmentName)
            yield tags.fieldset[tags.legend[f.title], f]
Esempio n. 5
0
 def createResource(self):
     return PublicAthenaLivePage(self.store,
                                 getLoader("signup"),
                                 IStaticShellContent(self.store, None),
                                 None,
                                 iface=ITicketIssuer,
                                 rootObject=self)
Esempio n. 6
0
 def render_addGrabberForm(self, ctx, data):
     f = liveform.LiveForm(
         self.addGrabber,
         [
             liveform.Parameter('domain', liveform.TEXT_INPUT, unicode,
                                u'Domain',
                                u'The domain which hosts the account.'),
             liveform.Parameter(
                 'username', liveform.TEXT_INPUT, unicode, u'Username',
                 u'The username portion of the address from which to retrieve messages.'
             ),
             liveform.Parameter('password1', liveform.PASSWORD_INPUT,
                                unicode, u'Password',
                                u'The password for the remote account.'),
             liveform.Parameter('password2', liveform.PASSWORD_INPUT,
                                unicode, u'Repeat Password'),
             # Along with the above, this might be useful if we had an IMAP grabber.
             #              liveform.Parameter('protocol',
             #                                 liveform.Choice(grabberTypes.keys()),
             #                                 lambda value: grabberTypes[value],
             #                                 u'Super secret computer science stuff',
             #                                 'POP3'),
             liveform.Parameter('ssl', liveform.CHECKBOX_INPUT, bool,
                                u'Use SSL to fetch messages')
         ],
         description='Add Grabber')
     f.jsClass = u'Quotient.Grabber.AddGrabberFormWidget'
     f.setFragmentParent(self)
     f.docFactory = webtheme.getLoader('liveform-compact')
     return ctx.tag[f]
Esempio n. 7
0
    def fragments(self, req, tag):
        """
        Render our preference collection, any child preference
        collections we discover by looking at self.tab.children,
        and any fragments returned by its C{getSections} method.

        Subtabs and C{getSections} fragments are rendered as fieldsets
        inside the parent preference collection's tab.
        """
        f = self._collectionToLiveform()
        if f is not None:
            yield tags.fieldset[tags.legend[self.tab.name], f]

        for t in self.tab.children:
            f = inevow.IRenderer(
                    self.collection.store.getItemByID(t.storeID))
            f.tab = t
            if hasattr(f, 'setFragmentParent'):
                f.setFragmentParent(self)
            yield f

        for f in self.collection.getSections() or ():
            f = ixmantissa.INavigableFragment(f)
            f.setFragmentParent(self)
            f.docFactory = getLoader(f.fragmentName)
            yield tags.fieldset[tags.legend[f.title], f]
Esempio n. 8
0
 def test_getLoader(self):
     """
     getLoader should search available themes for the named
     template and return it.
     """
     self.assertEquals(webtheme.getLoader('template'),
                       ['foo', 'template'])
Esempio n. 9
0
    def setUp(self, peopleAddresses, sender, recipient, cc):
        """
        Setup & populate a store with a L{xquotient.exmess.Message} which has
        correspondents set to the values of C{cc} and C{recipient}, and a
        person for each email address in C{peopleAddresses}

        @param sender: address to use as the value of the C{from} header
        @type cc: C{unicode}

        @param recipient: address to use as the value of the C{recipient}
        attribute
        @type cc: C{unicode}

        @param cc: addresses to use as the value of the C{cc} header
        @type cc: C{unicode}

        @type headers: C{dict} of C{unicode}
        """
        headers = {u'from': sender}
        if cc:
            headers[u'cc'] = cc
        msg = self._setUpMsg(headers)
        msg.recipient = recipient
        for addr in peopleAddresses:
            people.EmailAddress(
                store=msg.store,
                address=addr,
                person=people.Person(
                    store=msg.store,
                    organizer=self.organizer))
        f = MessageDetail(msg)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 10
0
 def createResource(self):
     return PublicAthenaLivePage(
         self.store,
         getLoader("signup"),
         IStaticShellContent(self.store, None),
         None,
         iface = ITicketIssuer,
         rootObject = self)
Esempio n. 11
0
    def __init__(self, store):
        ScrollingFragment.__init__(self, store, POP3Grabber, None,
                                   [POP3Grabber.username,
                                    POP3Grabber.domain,
                                    POP3Grabber.paused,
                                    StatusColumn(POP3Grabber.status, self)])

        self.docFactory = webtheme.getLoader(self.fragmentName)
Esempio n. 12
0
 def __init__(self, email):
     """
     @param email: an email address
     @type email: L{xquotient.mimeutil.EmailAddress}
     """
     self.email = email
     athena.LiveFragment.__init__(
         self, docFactory=getLoader('sender-person'))
Esempio n. 13
0
 def fromAddressScrollTable(self, req, tag):
     """
     @return: L{FromAddressScrollTable}
     """
     f = FromAddressScrollTable(self.composePrefs.store)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     return f
Esempio n. 14
0
 def userBrowser(self, request, tag):
     """
     Render a TDB of local users.
     """
     f = LocalUserBrowserFragment(self.browser)
     f.docFactory = webtheme.getLoader(f.fragmentName)
     f.setFragmentParent(self)
     return f
Esempio n. 15
0
 def __init__(self, email):
     """
     @param email: an email address
     @type email: L{xquotient.mimeutil.EmailAddress}
     """
     self.email = email
     athena.LiveFragment.__init__(self,
                                  docFactory=getLoader('sender-person'))
Esempio n. 16
0
 def fromAddressScrollTable(self, req, tag):
     """
     @return: L{FromAddressScrollTable}
     """
     f = FromAddressScrollTable(self.composePrefs.store)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     return f
Esempio n. 17
0
def getLoader(*a, **kw):
    """
    Deprecated.  Don't use this.
    """
    warn("xmantissa.publicweb.getLoader is deprecated, use "
         "PrivateApplication.getDocFactory or SiteTemplateResolver."
         "getDocFactory.", category=DeprecationWarning, stacklevel=2)
    from xmantissa.webtheme import getLoader
    return getLoader(*a, **kw)
 def getScrollingWidget(self, howManyElements=0):
     store = Store()
     installOn(PrivateApplication(store=store), store)
     for n in xrange(howManyElements):
         testMessageFactory(store, spam=False)
     f = MailboxScrollingFragment(store)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     return f
Esempio n. 19
0
    def _renderFragment(self, fragment, *a, **k):
        """
        Render the fragment C{fragment}

        @rtype: L{twisted.internet.defer.Deferred} firing with string
        rendering result
        """
        fragment.docFactory = webtheme.getLoader(fragment.fragmentName)
        return renderLivePage(FragmentWrapper(fragment), *a, **k)
Esempio n. 20
0
    def _getBlurb(self, flavor):
        self._setUpStore()
        share = self._shareAndGetProxy(self._makeBlurb(flavor))

        f = hyperbola_view.blurbViewDispatcher(share)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)

        return f
Esempio n. 21
0
 def __init__(self, original):
     for resource, domain in userbase.getAccountNames(original.installedOn):
         username = '******' % (resource, domain)
         break
     else:
         username = None
     PublicPage.__init__(self, original, original.store.parent, getLoader('initialize'),
                         IStaticShellContent(original.installedOn, None),
                         username)
Esempio n. 22
0
 def setUp(self):
     """
     Setup & populate a store, and render a
     L{xquotient.exmess.MessageDetail}
     """
     f = MessageDetail(self._setUpMsg())
     f.setFragmentParent(self)
     f.docFactory = getLoader(f.fragmentName)
     return f
Esempio n. 23
0
    def _renderFragment(self, fragment, *a, **k):
        """
        Render the fragment C{fragment}

        @rtype: L{twisted.internet.defer.Deferred} firing with string
        rendering result
        """
        fragment.docFactory = webtheme.getLoader(fragment.fragmentName)
        return renderLivePage(FragmentWrapper(fragment), *a, **k)
Esempio n. 24
0
 def getScrollingWidget(self, howManyElements=0):
     store = Store()
     installOn(PrivateApplication(store=store), store)
     for n in xrange(howManyElements):
         testMessageFactory(store, spam=False)
     f = MailboxScrollingFragment(store)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     return f
Esempio n. 25
0
 def __init__(self, original):
     for resource, domain in userbase.getAccountNames(original.installedOn):
         username = '******' % (resource, domain)
         break
     else:
         username = None
     PublicPage.__init__(self, original, original.store.parent,
                         getLoader('initialize'),
                         IStaticShellContent(original.installedOn, None),
                         username)
Esempio n. 26
0
 def getScrollingWidget(self, key, rowCount=10):
     store = Store()
     installOn(PrivateApplication(store=store), store)
     elements = [ScrollElement(store=store, column=i) for i in range(rowCount)]
     columns = [ScrollElement.column]
     f = SequenceScrollingFragment(store, elements, columns)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     self.perTestData[key] = (store, elements, f)
     return f
Esempio n. 27
0
    def getWidgetDocument(self):
        s = Store()

        grabberConfig = grabber.GrabberConfiguration(store=s)
        installOn(grabberConfig, s)

        f = grabber.GrabberConfigFragment(grabberConfig)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
    def getWidgetDocument(self):
        s = Store()

        grabberConfig = grabber.GrabberConfiguration(store=s)
        installOn(grabberConfig, s)

        f = grabber.GrabberConfigFragment(grabberConfig)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 29
0
    def compact(self):
        """
        Switch to the compact variant of the live form template.

        By default, this will simply create a loader for the
        C{self.compactFragmentName} template and compact all of this form's
        parameters.
        """
        self.docFactory = webtheme.getLoader(self.compactFragmentName)
        for param in self.parameters:
            param.compact()
Esempio n. 30
0
    def compact(self):
        """
        Switch to the compact variant of the live form template.

        By default, this will simply create a loader for the
        C{self.compactFragmentName} template and compact all of this form's
        parameters.
        """
        self.docFactory = webtheme.getLoader(self.compactFragmentName)
        for param in self.parameters:
            param.compact()
Esempio n. 31
0
 def setUp(self, key):
     """
     Setup & populate a store, and render a
     L{xquotient.exmess.MessageDetail}
     """
     msg = self._setUpMsg()
     self._stores[key] = msg.store
     f = MessageDetail(msg)
     f.setFragmentParent(self)
     f.docFactory = getLoader(f.fragmentName)
     return f
Esempio n. 32
0
    def _getMessageBody(self):
        """
        Get a widget which will be used to render the body of the message
        we're redirecting

        @rtype: L{ActionlessMessageDetail}
        """
        f = ActionlessMessageDetail(self.message)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 33
0
    def setUp(self, headers):
        """
        Setup & populate a store with a L{xquotient.exmess.Message} which has
        the headers in C{headers} set to the given values

        @type headers: C{dict} of C{unicode}
        """
        msg = self._setUpMsg(headers)
        f = MessageDetail(msg)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 34
0
def getLoader(*a, **kw):
    """
    Deprecated.  Don't use this.
    """
    warn(
        "xmantissa.publicweb.getLoader is deprecated, use "
        "PrivateApplication.getDocFactory or SiteTemplateResolver."
        "getDocFactory.",
        category=DeprecationWarning,
        stacklevel=2)
    from xmantissa.webtheme import getLoader
    return getLoader(*a, **kw)
Esempio n. 35
0
 def getScrollingWidget(self, key, rowCount=10):
     store = Store()
     installOn(PrivateApplication(store=store), store)
     elements = [
         ScrollElement(store=store, column=i) for i in range(rowCount)
     ]
     columns = [ScrollElement.column]
     f = SequenceScrollingFragment(store, elements, columns)
     f.docFactory = getLoader(f.fragmentName)
     f.setFragmentParent(self)
     self.perTestData[key] = (store, elements, f)
     return f
Esempio n. 36
0
 def getScrollingElement(self, rowCount):
     """
     Get a L{ScrollingElement}
     """
     s = Store()
     for x in xrange(rowCount):
         SampleRowItem(value=(x + 1) * 50, store=s)
     scrollingElement = ScrollingElement(s, SampleRowItem, None,
                                         (SampleRowItem.value, ), None,
                                         True, FakeTranslator(s))
     scrollingElement.setFragmentParent(self)
     scrollingElement.docFactory = getLoader(scrollingElement.fragmentName)
     return scrollingElement
Esempio n. 37
0
 def render_addRule(self, ctx, data):
     f = liveform.LiveForm(
         self.addRule,
         [liveform.Parameter('headerName', None, lambda s: s.strip().lower()),
          liveform.Parameter('negate', None, lambda s: bool([u"does", u"doesn't"].index(s))),
          liveform.Parameter('operation', None, _namesToOps.__getitem__),
          liveform.Parameter('value', None, unicode),
          liveform.Parameter('shortCircuit', None, bool),
          liveform.Parameter('caseSensitive', None, bool),
          liveform.Parameter('tagName', None, unicode)])
     f.jsClass = u'Quotient.Filter.RuleWidget'
     f.docFactory = webtheme.getLoader('add-filtering-rule')
     f.setFragmentParent(self)
     return ctx.tag[f]
Esempio n. 38
0
 def getScrollingElement(self, rowCount):
     """
     Get a L{ScrollingElement}
     """
     s = Store()
     for x in xrange(rowCount):
         SampleRowItem(value=(x + 1) * 50, store=s)
     scrollingElement = ScrollingElement(
         s, SampleRowItem, None, (SampleRowItem.value,), None, True,
         FakeTranslator(s))
     scrollingElement.setFragmentParent(self)
     scrollingElement.docFactory = getLoader(
         scrollingElement.fragmentName)
     return scrollingElement
Esempio n. 39
0
 def tcpPorts(self, req, tag):
     """
     Create and return a L{PortScrollingFragment} for the L{TCPPort} items
     in site store.
     """
     f = PortScrollingFragment(
         self.store,
         TCPPort,
         (TCPPort.portNumber,
          TCPPort.interface,
          FactoryColumn(TCPPort.factory)))
     f.setFragmentParent(self)
     f.docFactory = webtheme.getLoader(f.fragmentName)
     return tag[f]
Esempio n. 40
0
 def search(self, ctx, data):
     if self.searchResults:
         f = scrolltable.SearchResultScrollingFragment(
             self.store, self.searchResults,
             (scrolltable.UnsortableColumn(exmess.Message.senderDisplay),
              scrolltable.UnsortableColumn(exmess.Message.subject),
              scrolltable.UnsortableColumnWrapper(
                  scrolltable.TimestampAttributeColumn(
                      exmess.Message.sentWhen)),
              scrolltable.UnsortableColumn(exmess.Message.read)))
         f.jsClass = u'Quotient.Search.SearchResults'
         f.setFragmentParent(self)
         f.docFactory = webtheme.getLoader(f.fragmentName)
         return f
     return tags.h2['No results']
Esempio n. 41
0
 def sslPorts(self, req, tag):
     """
     Create and return a L{PortScrollingFragment} for the L{SSLPort} items
     in the site store.
     """
     f = PortScrollingFragment(
         self.store,
         SSLPort,
         (SSLPort.portNumber,
          SSLPort.interface,
          CertificateColumn(SSLPort.certificatePath),
          FactoryColumn(SSLPort.factory)))
     f.setFragmentParent(self)
     f.docFactory = webtheme.getLoader(f.fragmentName)
     return tag[f]
Esempio n. 42
0
    def render_callTDB(self, ctx, data):
        prefs = ixmantissa.IPreferenceAggregator(self.original.store)

        tdm = tdb.TabularDataModel(self.original.store,
                                   Call, (Call.time, Call.uri, Call.kind),
                                   itemsPerPage=prefs.getPreferenceValue('itemsPerPage'))

        cviews = (tdbview.DateColumnView('time'),
                  tdbview.ColumnViewBase('uri'),
                  tdbview.ColumnViewBase('kind'))

        tdv = tdbview.TabularDataView(tdm, cviews, width='100%')
        tdv.docFactory = getLoader(tdv.fragmentName)
        tdv.setFragmentParent(self)
        return tdv
Esempio n. 43
0
    def render_voicemailTDB(self, ctx, data):
        from sine.confession import Recording
        prefs = ixmantissa.IPreferenceAggregator(self.original.store)

        tdm = tdb.TabularDataModel(self.original.store,
                                   Recording, (Recording.fromAddress, Recording.length, Recording.time),
                                   itemsPerPage=prefs.getPreferenceValue('itemsPerPage'))

        cviews = (tdbview.ColumnViewBase('fromAddress'),
                  tdbview.ColumnViewBase('length'),
                  tdbview.DateColumnView('time'))

        tdv = tdbview.TabularDataView(tdm, cviews,  (ListenToRecordingAction(),),width='100%')
        tdv.docFactory = getLoader(tdv.fragmentName)
        tdv.setFragmentParent(self)
        return tdv
    def getWidgetDocument(self):
        s = Store()

        grabberConfig = grabber.GrabberConfiguration(store=s)
        installOn(grabberConfig, s)

        self.grabber = grabber.POP3Grabber(store=s,
                                           config=grabberConfig,
                                           username=u'foo',
                                           domain=u'bar',
                                           password=u'baz')

        f = grabber.GrabberConfigFragment(grabberConfig)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 45
0
    def render_callTDB(self, ctx, data):
        prefs = ixmantissa.IPreferenceAggregator(self.original.store)

        tdm = tdb.TabularDataModel(
            self.original.store,
            Call, (Call.time, Call.uri, Call.kind),
            itemsPerPage=prefs.getPreferenceValue('itemsPerPage'))

        cviews = (tdbview.DateColumnView('time'),
                  tdbview.ColumnViewBase('uri'),
                  tdbview.ColumnViewBase('kind'))

        tdv = tdbview.TabularDataView(tdm, cviews, width='100%')
        tdv.docFactory = getLoader(tdv.fragmentName)
        tdv.setFragmentParent(self)
        return tdv
Esempio n. 46
0
def scroller():
    """
    Create a scrolling element with a large number of rows for use in an
    interactive demonstration.
    """
    aStore = Store()
    populate(aStore)
    se = ScrollingElement(aStore, Sample, None,
                          [Sample.quantity,
                           Sample.date,
                           Sample.title,
                           SampleColorWidgetColumn()],
                          webTranslator=FakeTranslator(aStore),
                          defaultSortAscending=False)
    se.docFactory = getLoader(se.fragmentName)
    return se
Esempio n. 47
0
def scroller():
    """
    Create a scrolling element with a large number of rows for use in an
    interactive demonstration.
    """
    aStore = Store()
    populate(aStore)
    se = ScrollingElement(aStore,
                          Sample,
                          None, [
                              Sample.quantity, Sample.date, Sample.title,
                              SampleColorWidgetColumn()
                          ],
                          webTranslator=FakeTranslator(aStore),
                          defaultSortAscending=False)
    se.docFactory = getLoader(se.fragmentName)
    return se
Esempio n. 48
0
    def addAddressForm(self, req, tag):
        """
        @return: an L{xmantissa.liveform.LiveForm} instance which allows users
                 to add from addresses
        """
        def makeRequiredCoercer(paramName, coerce=lambda v: v):
            def notEmpty(value):
                if not value:
                    raise liveform.InvalidInput('value required for ' + paramName)
                return coerce(value)
            return notEmpty

        def textParam(name, label, *a):
            return liveform.Parameter(
                    name, liveform.TEXT_INPUT, makeRequiredCoercer(name), label, *a)

        # ideally we would only show the "address" input by default and have a
        # "SMTP Info" disclosure link which exposes the rest of them

        lf = liveform.LiveForm(
                self.addAddress,
                (textParam('address',  'Email Address'),
                 textParam('smtpHost', 'SMTP Host'),
                 liveform.Parameter(
                    'smtpPort',
                    liveform.TEXT_INPUT,
                    makeRequiredCoercer('smtpPort', int),
                    'SMTP Port',
                    default=25),
                 textParam('smtpUsername', 'SMTP Username'),
                 liveform.Parameter(
                    'smtpPassword',
                     liveform.PASSWORD_INPUT,
                     makeRequiredCoercer('smtpPassword'),
                     'SMTP Password'),
                 liveform.Parameter(
                    'default',
                    liveform.CHECKBOX_INPUT,
                    bool,
                    'Default?',
                    'Use this as default from address')),
                 description='Add From Address')
        lf.jsClass = u'Quotient.Compose.AddAddressFormWidget'
        lf.docFactory = getLoader('liveform-compact')
        lf.setFragmentParent(self)
        return lf
Esempio n. 49
0
    def getWidgetDocument(self):
        s = Store()

        grabberConfig = grabber.GrabberConfiguration(store=s)
        installOn(grabberConfig, s)

        self.grabber = grabber.POP3Grabber(
                            store=s,
                            config=grabberConfig,
                            username=u'foo',
                            domain=u'bar',
                            password=u'baz')

        f = grabber.GrabberConfigFragment(grabberConfig)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f
Esempio n. 50
0
    def addAddressForm(self, req, tag):
        """
        @return: an L{xmantissa.liveform.LiveForm} instance which allows users
                 to add from addresses
        """
        def makeRequiredCoercer(paramName, coerce=lambda v: v):
            def notEmpty(value):
                if not value:
                    raise liveform.InvalidInput('value required for ' +
                                                paramName)
                return coerce(value)

            return notEmpty

        def textParam(name, label, *a):
            return liveform.Parameter(name, liveform.TEXT_INPUT,
                                      makeRequiredCoercer(name), label, *a)

        # ideally we would only show the "address" input by default and have a
        # "SMTP Info" disclosure link which exposes the rest of them

        lf = liveform.LiveForm(
            self.addAddress,
            (textParam('address',
                       'Email Address'), textParam('smtpHost', 'SMTP Host'),
             liveform.Parameter(
                 'smtpPort',
                 liveform.TEXT_INPUT,
                 makeRequiredCoercer('smtpPort', int),
                 'SMTP Port',
                 default=25), textParam('smtpUsername', 'SMTP Username'),
             liveform.Parameter('smtpPassword', liveform.PASSWORD_INPUT,
                                makeRequiredCoercer('smtpPassword'),
                                'SMTP Password'),
             liveform.Parameter('default', liveform.CHECKBOX_INPUT, bool,
                                'Default?',
                                'Use this as default from address')),
            description='Add From Address')
        lf.jsClass = u'Quotient.Compose.AddAddressFormWidget'
        lf.docFactory = getLoader('liveform-compact')
        lf.setFragmentParent(self)
        return lf
Esempio n. 51
0
    def render_voicemailTDB(self, ctx, data):
        from sine.confession import Recording
        prefs = ixmantissa.IPreferenceAggregator(self.original.store)

        tdm = tdb.TabularDataModel(
            self.original.store,
            Recording,
            (Recording.fromAddress, Recording.length, Recording.time),
            itemsPerPage=prefs.getPreferenceValue('itemsPerPage'))

        cviews = (tdbview.ColumnViewBase('fromAddress'),
                  tdbview.ColumnViewBase('length'),
                  tdbview.DateColumnView('time'))

        tdv = tdbview.TabularDataView(tdm,
                                      cviews, (ListenToRecordingAction(), ),
                                      width='100%')
        tdv.docFactory = getLoader(tdv.fragmentName)
        tdv.setFragmentParent(self)
        return tdv
Esempio n. 52
0
 def render_postiniForm(self, ctx, data):
     f = liveform.LiveForm(self.configurePostini, [
         liveform.Parameter('usePostiniScore',
                            liveform.CHECKBOX_INPUT,
                            bool,
                            u'Use Postini Score',
                            u'Classify messages based on Postini scores.',
                            default=self.filter.usePostiniScore),
         liveform.Parameter('postiniThreshhold',
                            liveform.TEXT_INPUT,
                            float,
                            u'Postini Threshold',
                            u'Score below which to consider messages spam.',
                            default=self.filter.postiniThreshhold)
     ],
                           description='Configure Postini')
     f.jsClass = u"Quotient.Spam.PostiniSettings"
     f.setFragmentParent(self)
     f.docFactory = getLoader('liveform-compact')
     return ctx.tag[f]
Esempio n. 53
0
    def _makeALiveForm(self, parameters, identifier, removable=True):
        """
        Make a live form with the parameters C{parameters}, which will be used
        to edit the values/model object with identifier C{identifier}.

        @type parameters: C{list}
        @param parameters: list of L{Parameter} instances.

        @type identifier: C{int}

        @type removable: C{bool}

        @rtype: L{repeatedLiveFormWrapper}
        """
        liveForm = self.liveFormFactory(lambda **k: None, parameters,
                                        self.name)
        liveForm = self._prepareSubForm(liveForm)
        liveForm = self.repeatedLiveFormWrapper(liveForm, identifier,
                                                removable)
        liveForm.docFactory = webtheme.getLoader(liveForm.fragmentName)
        return liveForm
Esempio n. 54
0
    def getFromAddressScrollTable(self):
        s = Store()

        LoginMethod(store=s,
                    internal=False,
                    protocol=u'email',
                    localpart=u'default',
                    domain=u'host',
                    verified=True,
                    account=s)

        installOn(compose.Composer(store=s), s)

        smtpout.FromAddress(store=s,
                            address=u'notdefault@host',
                            smtpHost=u'host',
                            smtpUsername=u'notdefault')

        f = smtpout.FromAddressScrollTable(s)
        f.setFragmentParent(self)
        f.docFactory = getLoader(f.fragmentName)
        return f