def InitWidgets(self):
        panel = wx.Panel(self, -1)
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(panel, 1, wx.ALL|wx.EXPAND)
        self.SetSizer(sizer_1)

        self.myOlv = VirtualObjectListView(panel, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_2.Add(self.myOlv, 1, wx.ALL|wx.EXPAND, 4)
        panel.SetSizer(sizer_2)

        self.Layout()
Exemple #2
0
    def setUp(self):
        super(TestVirtualObjectListView, self).setUp()

        panel = wx.Panel(self.frame, -1)
        self.objectListView = VirtualObjectListView(panel,
                                                    -1,
                                                    style=wx.LC_REPORT
                                                    | wx.SUNKEN_BORDER)
        sizerPanel = wx.BoxSizer(wx.VERTICAL)
        sizerPanel.Add(self.objectListView, 1, wx.ALL | wx.EXPAND, 4)
        panel.SetSizer(sizerPanel)

        sizerFrame = wx.BoxSizer(wx.VERTICAL)
        sizerFrame.Add(panel, 1, wx.ALL | wx.EXPAND, 4)
        self.frame.SetSizer(sizerFrame)

        loadOLV(self.objectListView)
        # need to set item count for this one
        self.objectListView.SetItemCount(len(persons))

        self.objectListView.SetObjectGetter(lambda i: persons[i])
        self.objectListView.Bind(EVT_SORT, self._handleSort)
        def __init__(self, *args, **kwds):
            kwds["style"] = wx.DEFAULT_FRAME_STYLE
            wx.Frame.__init__(self, *args, **kwds)

            global theObjectListView, theFastObjectListView, theVirtualObjectListView, theGroupObjectListView, theFrame
            theFrame = self

            self.panel = wx.Panel(self, -1)
            theObjectListView = ObjectListView(self.panel,
                                               -1,
                                               style=wx.LC_REPORT
                                               | wx.SUNKEN_BORDER)
            theFastObjectListView = FastObjectListView(self.panel,
                                                       -1,
                                                       style=wx.LC_REPORT
                                                       | wx.SUNKEN_BORDER)
            theVirtualObjectListView = VirtualObjectListView(
                self.panel, -1, style=wx.LC_REPORT | wx.SUNKEN_BORDER)
            theGroupObjectListView = GroupListView(self.panel,
                                                   -1,
                                                   style=wx.LC_REPORT
                                                   | wx.SUNKEN_BORDER)

            sizer_2 = wx.BoxSizer(wx.VERTICAL)
            sizer_2.Add(theObjectListView, 1, wx.ALL | wx.EXPAND, 4)
            sizer_2.Add(theFastObjectListView, 1, wx.ALL | wx.EXPAND, 4)
            sizer_2.Add(theVirtualObjectListView, 1, wx.ALL | wx.EXPAND, 4)
            sizer_2.Add(theGroupObjectListView, 1, wx.ALL | wx.EXPAND, 4)
            self.panel.SetSizer(sizer_2)
            self.panel.Layout()

            sizer_1 = wx.BoxSizer(wx.VERTICAL)
            sizer_1.Add(self.panel, 1, wx.EXPAND)
            self.SetSizer(sizer_1)
            self.Layout()

            wx.CallAfter(self.runTests)
Exemple #4
0
class TestVirtualObjectListView(TestObjectListView):
    def setUp(self):
        super(TestVirtualObjectListView, self).setUp()

        panel = wx.Panel(self.frame, -1)
        self.objectListView = VirtualObjectListView(panel,
                                                    -1,
                                                    style=wx.LC_REPORT
                                                    | wx.SUNKEN_BORDER)
        sizerPanel = wx.BoxSizer(wx.VERTICAL)
        sizerPanel.Add(self.objectListView, 1, wx.ALL | wx.EXPAND, 4)
        panel.SetSizer(sizerPanel)

        sizerFrame = wx.BoxSizer(wx.VERTICAL)
        sizerFrame.Add(panel, 1, wx.ALL | wx.EXPAND, 4)
        self.frame.SetSizer(sizerFrame)

        loadOLV(self.objectListView)
        # need to set item count for this one
        self.objectListView.SetItemCount(len(persons))

        self.objectListView.SetObjectGetter(lambda i: persons[i])
        self.objectListView.Bind(EVT_SORT, self._handleSort)

    def _handleSort(self, evt):
        col = evt.objectListView.columns[evt.sortColumnIndex]

        def _getLowerCaseSortValue(x):
            value = col.GetValue(x)
            if isinstance(value, six.string_types):
                return value.lower()
            else:
                return value

        persons.sort(key=_getLowerCaseSortValue,
                     reverse=(not evt.sortAscending))
        evt.objectListView.RefreshObjects()

    #-------------------------------------------------------------------------
    # Override inherited tests

    def getBackgroundColour(self, i):
        # There is no direct way to get the background colour of an item in a virtual
        # list, so we have to cheat by approximating the process of building a
        # list item
        attr = self.objectListView.OnGetItemAttr(i)
        if attr is None or not attr.HasBackgroundColour():
            # this returns an invalid color
            return self.objectListView.GetItemBackgroundColour(i)
        else:
            return attr.GetBackgroundColour()

    def testEmptyListMsg(self):
        self.objectListView.SetItemCount(0)
        self.assertTrue(self.objectListView.stEmptyListMsg.IsShown())

        self.objectListView.SetItemCount(len(persons))
        self.assertFalse(self.objectListView.stEmptyListMsg.IsShown())

    # Virtual lists can't get or set selected objects -- Is this really true?
    # Does it have to be?
    def testSelectObject(self):
        pass

    def testGetSelectedObject(self):
        pass

    def testGetSelectedObjects(self):
        pass

    # Virtual lists can't filter since the model objects are not controlly by
    # it
    def testFilteringHead(self):
        pass

    def testFilteringTail(self):
        pass

    def testFilteringPredicate(self):
        pass

    def testFilteringTextSearch(self):
        pass

    def testFilteringChain(self):
        pass
Exemple #5
0
class MyFrame(wx.Frame):

    CREATE_STMT = "CREATE TABLE tracks (trackId int, title text, artist text, album text, PRIMARY KEY (trackId))"
    INSERT_STMT = "INSERT INTO tracks VALUES(?, ?, ?, ?)"

    SELECT_ONE_STMT = "SELECT trackId, title, artist , album FROM tracks WHERE trackId=?"
    SELECT_IDS_STMT = "SELECT trackId FROM tracks ORDER BY %s %s"
    COUNT_ROWS_STMT = "SELECT count(*) FROM tracks"

    NUMBER_OF_ROWS = 100000

    def __init__(self, *args, **kwds):
        wx.Frame.__init__(self, *args, **kwds)
        self.Init()

    def Init(self):
        self.InitWidgets()
        self.InitObjectListView()
        wx.CallLater(1, self.InitModel)

    def InitModel(self):
        start = time.clock()
        path = os.path.join(wx.StandardPaths.Get().GetTempDir(),
                            "VirtualListExample.sqlite")
        if os.path.exists(path):
            os.remove(path)

        # Open the database and create a table on it
        self.connection = sqlite.connect(path)
        self.connection.row_factory = sqlite.Row
        self.connection.execute(self.CREATE_STMT)
        self.connection.commit()

        baseData = [
            {
                "title": "Shiver",
                "artist": "Natalie Imbruglia",
                "album": "Counting Down the Days"
            },
            {
                "title": "Who's Gonna Ride Your Wild Horses",
                "artist": "U2",
                "album": "Achtung Baby"
            },
            {
                "title": "So Cruel",
                "artist": "U2",
                "album": "Achtung Baby"
            },
            {
                "title": "The Fly",
                "artist": "U2",
                "album": "Achtung Baby"
            },
            {
                "title": "Fight For All The Wrong Reason",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "Photograph",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "Animals",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "Savin' Me",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "Far Away",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "Next Contestant",
                "artist": "Nickelback",
                "album": "All The Right Reasons"
            },
            {
                "title": "My Girl",
                "artist": "Hoodoo Gurus",
                "album": "Ampology"
            },
            {
                "title": "Be My Guru",
                "artist": "Hoodoo Gurus",
                "album": "Ampology"
            },
            {
                "title": "I Want You Back",
                "artist": "Hoodoo Gurus",
                "album": "Ampology"
            },
            {
                "title": "Dare you to move",
                "artist": "Switchfoot",
                "album": "The Beautiful Letdown"
            },
            {
                "title": "Redemption",
                "artist": "Switchfoot",
                "album": "The Beautiful Letdown"
            },
            {
                "title": "The beautiful letdown",
                "artist": "Switchfoot",
                "album": "The Beautiful Letdown"
            },
            {
                "title": "Death And All His Friends",
                "artist": "Coldplay",
                "album": "Viva la Vida"
            },
        ]

        i = 0
        while i < self.NUMBER_OF_ROWS:
            for x in baseData:
                self.connection.execute(
                    self.INSERT_STMT,
                    [i, x["title"] + str(i), x["artist"], x["album"]])
                i += 1
        self.connection.commit()

        # We use a reorder map when the list is sorted
        self.reorderList = []

        # We have to tell the control how many rows are in the database?
        cur = self.connection.cursor()
        cur.execute(self.COUNT_ROWS_STMT)
        result = cur.fetchone()
        self.myOlv.SetItemCount(int(result[0]))

        print "Building database %d rows of took %2f seconds." % (
            self.myOlv.GetItemCount(), time.clock() - start)

    def InitWidgets(self):
        panel = wx.Panel(self, -1)
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(panel, 1, wx.ALL | wx.EXPAND)
        self.SetSizer(sizer_1)

        self.myOlv = VirtualObjectListView(panel,
                                           -1,
                                           style=wx.LC_REPORT
                                           | wx.SUNKEN_BORDER)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_2.Add(self.myOlv, 1, wx.ALL | wx.EXPAND, 4)
        panel.SetSizer(sizer_2)

        self.Layout()

    def InitObjectListView(self):
        groupImage = self.myOlv.AddImages(ExampleImages.getGroup16Bitmap(),
                                          ExampleImages.getGroup32Bitmap())
        musicImage = self.myOlv.AddImages(ExampleImages.getMusic16Bitmap(),
                                          ExampleImages.getMusic32Bitmap())
        userImage = self.myOlv.AddImages(ExampleImages.getUser16Bitmap(),
                                         ExampleImages.getUser32Bitmap())

        soloArtists = [
            "Nelly Furtado", "Missy Higgins", "Moby", "Natalie Imbruglia"
        ]

        def artistImageGetter(track):
            if track["artist"] in soloArtists:
                return userImage
            else:
                return groupImage

        self.myOlv.SetColumns([
            ColumnDefn("Title", "left", 150, "title", imageGetter=musicImage),
            ColumnDefn("Artist",
                       "left",
                       150,
                       "artist",
                       imageGetter=artistImageGetter),
            ColumnDefn("Album", "center", 150, "album")
        ])

        # Fetch rows from the database when required
        # In a real app, this would cache a certain number of rows
        def fetchFromDatabase(rowIndex):
            cur = self.connection.cursor()
            if len(self.reorderList):
                rowIndex = self.reorderList[rowIndex]
            cur.execute(self.SELECT_ONE_STMT, (rowIndex, ))
            return cur.fetchone()

        self.myOlv.SetObjectGetter(fetchFromDatabase)

        # We want to receive sort events for the virtual list
        self.myOlv.EnableSorting()
        self.myOlv.Bind(EVT_SORT, self.HandleSort)

        # Let the user know that we are building the database
        self.myOlv.SetEmptyListMsg("Building database...")
        self.myOlv.SetItemCount(0)

    def HandleSort(self, evt):
        """
        The user wants to sort the virtual list.
        """
        start = time.clock()

        columnName = evt.objectListView.columns[
            evt.sortColumnIndex].valueGetter
        if evt.sortAscending:
            sorting = "ASC"
        else:
            sorting = "DESC"
        cur = self.connection.cursor()
        cur.execute(self.SELECT_IDS_STMT % (columnName, sorting))
        self.reorderList = [x[0] for x in cur.fetchall()]
        self.myOlv.RefreshObjects()

        print "Sorting took %2f seconds." % (time.clock() - start)
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=wx.EmptyString,
                          pos=wx.DefaultPosition,
                          size=wx.Size(500, 700),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        #self.dataframe = pd.DataFrame(self.GetTracks(), columns=['Title', 'Artist', 'Album', 'Last Played',
        #                                                              'SizeInBytes', 'Rating'])
        self.dataObjects = self.GetTracks()
        print "self.dataObjects[index % len(self.dataObjects)]: ", self.dataObjects[
            0 % len(self.dataObjects)]

        boxSizer = wx.BoxSizer(wx.VERTICAL)

        sbSizer1 = wx.StaticBoxSizer(
            wx.StaticBox(self, wx.ID_ANY, u"%s" % len(self.dataObjects)),
            wx.VERTICAL)
        self.olv = OLV(self, wx.ID_ANY, style=wx.LC_REPORT)
        self.olv.useAlternateBackColors = True
        self.olv.oddRowsBackColor = wx.Colour(191, 239, 255)
        self.olv.SetEmptyListMsg("Add points either by csv or manually")

        columns = [
            ColumnDefn("Title",
                       "left",
                       -1,
                       valueGetter="title",
                       minimumWidth=125),
            ColumnDefn("Artist",
                       "left",
                       -1,
                       valueGetter="artist",
                       minimumWidth=125),
            ColumnDefn("Album",
                       "left",
                       -1,
                       valueGetter="album",
                       minimumWidth=125),
            ColumnDefn("Last Played",
                       "left",
                       -1,
                       valueGetter="lastPlayed",
                       minimumWidth=125),
            # ColumnDefn("Date Played", "left", -1, valueGetter="date", minimumWidth=125),
            #ColumnDefn("Time Played", "left", -1, valueGetter="time", minimumWidth=125),
            ColumnDefn("SizeInBytes",
                       "left",
                       -1,
                       valueGetter="sizeInBytes",
                       minimumWidth=125),
            ColumnDefn("Rating",
                       "left",
                       -1,
                       valueGetter="rating",
                       minimumWidth=125),
        ]
        self.olv.SetColumns(columns)

        self.olv.SetObjectGetter(self.objectGetter)
        self.olv.SetItemCount(len(self.dataObjects))

        self.selectBtn = wx.Button(self, wx.ID_ANY, "Select 5 points randomly")
        boxSizer.Add(self.olv, 1, wx.ALL | wx.EXPAND, 5)
        boxSizer.Add(self.selectBtn, 0, wx.ALL, 5)

        sbSizer1.Add(boxSizer, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sbSizer1)
        self.Layout()

        self.Centre(wx.BOTH)
        self.selectBtn.Bind(wx.EVT_BUTTON, self.onButton)
        self.olv.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.onItemSelected)
        self.olv.Bind(wx.EVT_LIST_ITEM_SELECTED, self.GetOLVColClicked)

        # for wxMSW
        self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)

        # Register the "editor factory" for wx.Colour objects
        # CellEditorRegistry().RegisterCreatorFunction(time, self.timeEditor)
        self.Show()
class ExampleOlv(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self,
                          parent,
                          id=wx.ID_ANY,
                          title=wx.EmptyString,
                          pos=wx.DefaultPosition,
                          size=wx.Size(500, 700),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        #self.dataframe = pd.DataFrame(self.GetTracks(), columns=['Title', 'Artist', 'Album', 'Last Played',
        #                                                              'SizeInBytes', 'Rating'])
        self.dataObjects = self.GetTracks()
        print "self.dataObjects[index % len(self.dataObjects)]: ", self.dataObjects[
            0 % len(self.dataObjects)]

        boxSizer = wx.BoxSizer(wx.VERTICAL)

        sbSizer1 = wx.StaticBoxSizer(
            wx.StaticBox(self, wx.ID_ANY, u"%s" % len(self.dataObjects)),
            wx.VERTICAL)
        self.olv = OLV(self, wx.ID_ANY, style=wx.LC_REPORT)
        self.olv.useAlternateBackColors = True
        self.olv.oddRowsBackColor = wx.Colour(191, 239, 255)
        self.olv.SetEmptyListMsg("Add points either by csv or manually")

        columns = [
            ColumnDefn("Title",
                       "left",
                       -1,
                       valueGetter="title",
                       minimumWidth=125),
            ColumnDefn("Artist",
                       "left",
                       -1,
                       valueGetter="artist",
                       minimumWidth=125),
            ColumnDefn("Album",
                       "left",
                       -1,
                       valueGetter="album",
                       minimumWidth=125),
            ColumnDefn("Last Played",
                       "left",
                       -1,
                       valueGetter="lastPlayed",
                       minimumWidth=125),
            # ColumnDefn("Date Played", "left", -1, valueGetter="date", minimumWidth=125),
            #ColumnDefn("Time Played", "left", -1, valueGetter="time", minimumWidth=125),
            ColumnDefn("SizeInBytes",
                       "left",
                       -1,
                       valueGetter="sizeInBytes",
                       minimumWidth=125),
            ColumnDefn("Rating",
                       "left",
                       -1,
                       valueGetter="rating",
                       minimumWidth=125),
        ]
        self.olv.SetColumns(columns)

        self.olv.SetObjectGetter(self.objectGetter)
        self.olv.SetItemCount(len(self.dataObjects))

        self.selectBtn = wx.Button(self, wx.ID_ANY, "Select 5 points randomly")
        boxSizer.Add(self.olv, 1, wx.ALL | wx.EXPAND, 5)
        boxSizer.Add(self.selectBtn, 0, wx.ALL, 5)

        sbSizer1.Add(boxSizer, 1, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(sbSizer1)
        self.Layout()

        self.Centre(wx.BOTH)
        self.selectBtn.Bind(wx.EVT_BUTTON, self.onButton)
        self.olv.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.onItemSelected)
        self.olv.Bind(wx.EVT_LIST_ITEM_SELECTED, self.GetOLVColClicked)

        # for wxMSW
        self.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
        self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick)

        # Register the "editor factory" for wx.Colour objects
        # CellEditorRegistry().RegisterCreatorFunction(time, self.timeEditor)
        self.Show()

    def OnRightClick(self, event):
        """
        Allow users to sort based off of column
        """
        ## Get column clicked
        selected_column = self.GetOLVColClicked(event=None)
        print "OnrightClick", selected_column

    def objectGetter(self, index):
        """
        A Virtual list has to have a callable installed that says which model object is shown
        at a given index
        """
        return self.dataObjects[index % len(self.dataObjects)]

    def GetOLVColClicked(self, event):

        # [email protected]  2011-01 Jan-13
        # For use with a 3rd party module named ObjectListView
        # used with wxPython.
        """
        GetColClicked( event ) -> int Column number of mouse click.

        Get ObjectListView() column the user single-left-clicked the mouse in.

        You can use the column number to set the modelObject's attributes
        without removing, re-adding, resorting the items in the OVL.

        This event handler is often bound to the event handler of the
        wx.EVT_LIST_ITEM_SELECTED event. Other events may be needed for
        the column's labels - the labels visually naming a column.

        This assumes the OLV.LayoutDirection() is LTR.
        """

        # ----------------------------------------------------------
        # Get the mouse position. Determine which column the user
        # clicked in.
        # This could probably all be done in some list hit test event.
        # Not all OS platforms set all events m_...atributes. This is a
        # work around.

        # Get point user clicked, here in screen coordinates.
        # Then convert the point to OVL control coordinates.

        spt = wx.GetMousePosition()
        fpt = self.olv.ScreenToClient(spt)  # USE THIS ONE
        x, y = fpt

        # log( o, "GetOLVColClicked()                                   event.m_col: %d "% event.m_col)
        #log( o, "GetOLVColClicked()    folv.ScreenToClient(wx.GetMousePosition()): %d "% x)

        # Get all column widths, individually, of the OLV control .
        # Then compare if the mouse clicked in that column.

        # Make this a per-click calculation as column widths can
        # change often by the user and dynamically by different
        # lengths of data strings in rows.

        last_col = 0
        col_selected = None
        for col in range(self.olv.GetColumnCount()):

            # Get this OLV column's width in pixels.

            col_width = self.olv.GetColumnWidth(col)

            # Calculate the left and right vertical pixel positions
            # of this current column.

            left_pxl_col = last_col
            right_pxl_col = last_col + col_width - 1

            # Compare mouse click point in control coordinates,
            # (verse screen coordinates) to left and right coordinate of
            # each column consecutively until found.

            if left_pxl_col <= x <= right_pxl_col:
                # Mouse was clicked in the current column "col"; done

                col_selected = col
                break

            col_selected = None
            # prep for next calculation of next column

            last_col = last_col + col_width
        print "Col_selected: ", col_selected
        return col_selected

    def onItemSelected(self, event):
        item = event.m_itemIndex
        # focusedItem = obj.GetFocusedItem()
        # obj.GetSelectedItems()
        # item = self.dataObjects[focusedItem]
        # for i in dir(obj):
        #   print i
        print "Selected Object: ", item, self.olv.GetItemText(
            item)  #, self.olv.GetItem(item, "SizeInBytes")

    def onButton(self, event):
        results = self.GetSelections()
        items = [0, 1, 5, 6, 8, 9, 10, 11, 15]

        #print items
        for i in items:
            self.olv.SetItemState(i, wx.LIST_STATE_SELECTED,
                                  wx.LIST_STATE_SELECTED)
            self.olv.Focus(i)
        # self.olv.SelectObjects(self.dataObjects[:5])
        print "Selecting ", len(results)

    def GetSelections(self):  # helper / used internally
        # return a (possibly empty) list of the
        # currently selected ROW indexes

        result = []
        iRow = -1
        while True:
            iRow = self.olv.GetNextItem(iRow, wx.LIST_NEXT_ALL,
                                        wx.LIST_STATE_SELECTED)
            if iRow < 0:
                break
            result.append(iRow)
        # print "GetSelections:", result
        return result

    def returnDatetime(self, i):
        return datetime.datetime.strptime(i, "%d/%m/%Y %H:%M")

    def GetTracks(self):
        """
        Return a collection of tracks
        """
        return [
            Track("shiver", "Natalie Imbruglia", "Counting Down the Days",
                  8.6 * 1024 * 1024 * 1024, "9/03/2008 9:51", 80),
            Track("Who's Gonna Ride Your Wild Horses", "U2", "Achtung Baby",
                  6.3 * 1024 * 1024, "9/10/2007 11:32", 80),
            Track("So Cruel", "U2", "Achtung Baby", 6.9 * 1024 * 1024,
                  "19/10/2007 11:42", 60),
            Track("The Fly", "U2", "Achtung Baby", 5.4 * 1024 * 1024,
                  "9/10/2007 11:42", 60),
            Track("Tryin' To Throw Your Arms Around The World", "U2",
                  "Achtung Baby", 4.7 * 1024 * 1024, "9/10/2007 11:46", 60),
            Track("Ultraviolet (Light My Way)", "U2", "Achtung Baby",
                  6.6 * 1024 * 1024, "9/10/2007 11:52", 60),
            Track("Acrobat", "U2", "Achtung Baby", 5.4 * 1024 * 1024,
                  "9/10/2007 11:56", 60),
            Track("Love Is Blindness", "U2", "Achtung Baby", 5.3 * 1024,
                  "9/10/2007 12:00", 60),
            Track("Elevation", "U2", "All That You Can't Leave Behind", 459,
                  "25/01/2008 11:46", 60),
            Track("Walk On", "U2", "All That You Can't Leave Behind",
                  5.8 * 1024 * 1024, "18/03/2008 11:39", 100),
            Track("Kite", "U2", "All That You Can't Leave Behind",
                  5.2 * 1024 * 1024, "23/01/2008 10:36", 40),
            Track("In A Little While", "U2", "All That You Can't Leave Behind",
                  4.3 * 1024 * 1024, "20/01/2008 7:48", 60),
            Track("Wild Honey", "U2", "All That You Can't Leave Behind",
                  4.5 * 1024 * 1024, "13/04/2007 11:50", 40),
            Track("Peace On Earth", "U2", "All That You Can't Leave Behind",
                  5.6 * 1024 * 1024, "22/12/2007 2:51", 40),
            Track("When I Look At The World", "U2",
                  "All That You Can't Leave Behind", 5.1 * 1024 * 1024,
                  "22/12/2007 2:55", 40),
            Track("New York", "U2", "All That You Can't Leave Behind",
                  6.4 * 1024 * 1024, "22/12/2007 3:01", 60),
            Track("Grace", "U2", "All That You Can't Leave Behind",
                  6.5 * 1024 * 1024, "22/12/2007 3:06", 40),
            Track("The Ground Beneath Her Feet(Bonus Track)", "U2",
                  "All That You Can't Leave Behind", 4.4 * 1024 * 1024,
                  "22/12/2007 3:10", 40),
            Track("Follow You Home", "Nickelback", "All The Right Reasons",
                  6 * 1024 * 1024, "6/03/2008 10:42", 40),
            Track("Fight For All The Wrong Reason", "Nickelback",
                  "All The Right Reasons", 5.2 * 1024 * 1024,
                  "15/03/2008 5:04", 60),
            Track("Photograph", "Nickelback", "All The Right Reasons",
                  6 * 1024 * 1024, "15/03/2008 5:08", 60),
            Track("Animals", "Nickelback", "All The Right Reasons",
                  4.3 * 1024 * 1024, "16/02/2008 12:12", 40),
            Track("Savin' Me", "Nickelback", "All The Right Reasons",
                  5.1 * 1024 * 1024, "24/03/2008 10:41", 80),
        ] * 50000  # * 1000000

    def GetTracksForDF(self):
        """
        Return a collection of tracks
        """
        return [[
            "shiver", "Natalie Imbruglia", "Counting Down the Days",
            8.6 * 1024 * 1024 * 1024, "9/03/2008 9:51", 80
        ],
                [
                    "Who's Gonna Ride Your Wild Horses", "U2", "Achtung Baby",
                    6.3 * 1024 * 1024, "9/10/2007 11:32", 80
                ],
                [
                    "So Cruel", "U2", "Achtung Baby", 6.9 * 1024 * 1024,
                    "19/10/2007 11:42", 60
                ],
                [
                    "The Fly", "U2", "Achtung Baby", 5.4 * 1024 * 1024,
                    "9/10/2007 11:42", 60
                ],
                [
                    "Tryin' To Throw Your Arms Around The World", "U2",
                    "Achtung Baby", 4.7 * 1024 * 1024, "9/10/2007 11:46", 60
                ],
                [
                    "Ultraviolet (Light My Way)", "U2", "Achtung Baby",
                    6.6 * 1024 * 1024, "9/10/2007 11:52", 60
                ],
                [
                    "Acrobat", "U2", "Achtung Baby", 5.4 * 1024 * 1024,
                    "9/10/2007 11:56", 60
                ],
                [
                    "Love Is Blindness", "U2", "Achtung Baby", 5.3 * 1024,
                    "9/10/2007 12:00", 60
                ],
                [
                    "Elevation", "U2", "All That You Can't Leave Behind", 459,
                    "25/01/2008 11:46", 60
                ],
                [
                    "Walk On", "U2", "All That You Can't Leave Behind",
                    5.8 * 1024 * 1024, "18/03/2008 11:39", 100
                ],
                [
                    "Kite", "U2", "All That You Can't Leave Behind",
                    5.2 * 1024 * 1024, "23/01/2008 10:36", 40
                ],
                [
                    "In A Little While", "U2",
                    "All That You Can't Leave Behind", 4.3 * 1024 * 1024,
                    "20/01/2008 7:48", 60
                ],
                [
                    "Wild Honey", "U2", "All That You Can't Leave Behind",
                    4.5 * 1024 * 1024, "13/04/2007 11:50", 40
                ],
                [
                    "Peace On Earth", "U2", "All That You Can't Leave Behind",
                    5.6 * 1024 * 1024, "22/12/2007 2:51", 40
                ],
                [
                    "When I Look At The World", "U2",
                    "All That You Can't Leave Behind", 5.1 * 1024 * 1024,
                    "22/12/2007 2:55", 40
                ],
                [
                    "New York", "U2", "All That You Can't Leave Behind",
                    6.4 * 1024 * 1024, "22/12/2007 3:01", 60
                ],
                [
                    "Grace", "U2", "All That You Can't Leave Behind",
                    6.5 * 1024 * 1024, "22/12/2007 3:06", 40
                ],
                [
                    "The Ground Beneath Her Feet(Bonus Track)", "U2",
                    "All That You Can't Leave Behind", 4.4 * 1024 * 1024,
                    "22/12/2007 3:10", 40
                ],
                [
                    "Follow You Home", "Nickelback", "All The Right Reasons",
                    6 * 1024 * 1024, "6/03/2008 10:42", 40
                ],
                [
                    "Fight For All The Wrong Reason", "Nickelback",
                    "All The Right Reasons", 5.2 * 1024 * 1024,
                    "15/03/2008 5:04", 60
                ],
                [
                    "Photograph", "Nickelback", "All The Right Reasons",
                    6 * 1024 * 1024, "15/03/2008 5:08", 60
                ],
                [
                    "Animals", "Nickelback", "All The Right Reasons",
                    4.3 * 1024 * 1024, "16/02/2008 12:12", 40
                ],
                [
                    "Savin' Me", "Nickelback", "All The Right Reasons",
                    5.1 * 1024 * 1024, "24/03/2008 10:41", 80
                ]] * 50000  # * 1000000

    def GetSample(self):

        return [
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
            [1, 2, 3, 4, 5, 6],
        ] * 9999