コード例 #1
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)
コード例 #2
0
ファイル: grabber.py プロジェクト: rcarmo/divmod.org
    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)
コード例 #3
0
 def __init__(self, userBrowser):
     ScrollingFragment.__init__(self, userBrowser.store.parent,
                                userbase.LoginMethod,
                                userbase.LoginMethod.domain != None,
                                (userbase.LoginMethod.localpart,
                                 userbase.LoginMethod.domain,
                                 userbase.LoginMethod.verified),
                                defaultSortColumn=userbase.LoginMethod.domain,
                                defaultSortAscending=True)
コード例 #4
0
ファイル: smtpout.py プロジェクト: pombredanne/quotient
 def __init__(self, store):
     ScrollingFragment.__init__(
             self, store,
             FromAddress,
             None,
             (FromAddressAddressColumn(),
              FromAddress.smtpHost,
              FromAddress.smtpPort,
              FromAddress.smtpUsername,
              FromAddress._default))
コード例 #5
0
    def test_oneSortableSortMetadata(self):
        """
        Same as L{test_allUnsortableSortMetadata}, but with one sortable column
        """
        sf = ScrollingFragment(self.store, DataThunk, None,
                               (DataThunk.a, UnsortableColumn(DataThunk.b)))

        meta = sf.getTableMetadata()
        cols = meta[1]
        self.assertEquals(cols['a'][1], True)
        self.assertEquals(cols['b'][1], False)
コード例 #6
0
    def test_allUnsortableSortMetadata(self):
        """
        Test that C{getTableMetadata} is correct with respect to the
        sortability of columns
        """
        sf = ScrollingFragment(
            self.store, DataThunk, None,
            (UnsortableColumn(DataThunk.a), UnsortableColumn(DataThunk.b)))

        meta = sf.getTableMetadata()
        cols = meta[1]
        self.assertEquals(cols['a'][1], False)
        self.assertEquals(cols['b'][1], False)
コード例 #7
0
    def test_oneSortableSortMetadata(self):
        """
        Same as L{test_allUnsortableSortMetadata}, but with one sortable column
        """
        sf = ScrollingFragment(
                self.store, DataThunk, None,
                (DataThunk.a,
                 UnsortableColumn(DataThunk.b)))

        meta = sf.getTableMetadata()
        cols = meta[1]
        self.assertEquals(cols['a'][1], True)
        self.assertEquals(cols['b'][1], False)
コード例 #8
0
    def test_allUnsortableSortMetadata(self):
        """
        Test that C{getTableMetadata} is correct with respect to the
        sortability of columns
        """
        sf = ScrollingFragment(
                self.store, DataThunk, None,
                (UnsortableColumn(DataThunk.a),
                 UnsortableColumn(DataThunk.b)))

        meta = sf.getTableMetadata()
        cols = meta[1]
        self.assertEquals(cols['a'][1], False)
        self.assertEquals(cols['b'][1], False)
コード例 #9
0
 def testSortsOnFirstSortable(self):
     """
     Test that the scrolltable sorts on the first sortable column
     """
     sf = ScrollingFragment(self.store, DataThunk, None,
                            (UnsortableColumn(DataThunk.a), DataThunk.b))
     self.assertEquals(sf.currentSortColumn, DataThunk.b)
コード例 #10
0
    def testSortsOnFirstSortable2(self):
        """
        Same as L{testSortsOnFirstSortable}, but for the case where the first
        sortable column is the first in the column list
        """
        sf = ScrollingFragment(self.store, DataThunk, None,
                               (DataThunk.a, UnsortableColumn(DataThunk.b)))

        self.assertIdentical(sf.currentSortColumn.sortAttribute(), DataThunk.a)
コード例 #11
0
    def testUnsortableColumnWrapper(self):
        """
        Test that an L{UnsortableColumnWrapper} wrapping an L{AttributeColumn}
        is treated the same as L{UnsortableColumn}
        """
        sf = ScrollingFragment(self.store, DataThunk, None,
                               (UnsortableColumnWrapper(
                                   AttributeColumn(DataThunk.a)), DataThunk.b))

        self.assertEquals(sf.currentSortColumn, DataThunk.b)
コード例 #12
0
    def testTestNoSortables(self):
        """
        Test that the scrolltable can handle the case where all columns are
        unsortable
        """
        sf = ScrollingFragment(
            self.store, DataThunk, None,
            (UnsortableColumn(DataThunk.a), UnsortableColumn(DataThunk.b)))

        self.assertEquals(sf.currentSortColumn, None)
コード例 #13
0
 def getScrollFragment(self):
     sf = ScrollingFragment(self.store, DataThunk, DataThunk.a > 4,
                            [DataThunk.b, DataThunk.c], DataThunk.a)
     sf.linkToItem = lambda ign: None
     return sf
コード例 #14
0
 def __init__(self, store):
     ScrollingFragment.__init__(
         self, store, FromAddress, None,
         (FromAddressAddressColumn(), FromAddress.smtpHost,
          FromAddress.smtpPort, FromAddress.smtpUsername,
          FromAddress._default))
コード例 #15
0
 def getScrollFragment(self):
     sf = ScrollingFragment(
         self.store, DataThunk, DataThunk.a > 4,
         [DataThunk.b, DataThunk.c], DataThunk.a)
     sf.linkToItem = lambda ign: None
     return sf