Beispiel #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)
Beispiel #2
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)
Beispiel #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)
Beispiel #4
0
 def __init__(self, store):
     ScrollingFragment.__init__(
             self, store,
             FromAddress,
             None,
             (FromAddressAddressColumn(),
              FromAddress.smtpHost,
              FromAddress.smtpPort,
              FromAddress.smtpUsername,
              FromAddress._default))
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #14
0
 def __init__(self, store):
     ScrollingFragment.__init__(
         self, store, FromAddress, None,
         (FromAddressAddressColumn(), FromAddress.smtpHost,
          FromAddress.smtpPort, FromAddress.smtpUsername,
          FromAddress._default))
Beispiel #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