Fixed order for get-items when there are already loaded items in lists

This commit is contained in:
Manuel Cortez 2016-03-23 02:15:52 -06:00
parent 4df86aa8a4
commit 1806db5670

View File

@ -46,7 +46,9 @@ class baseBuffer(object):
if show_nextpage == False: if show_nextpage == False:
if self.tab.list.get_count() > 0 and num > 0: if self.tab.list.get_count() > 0 and num > 0:
print "inserting a value" print "inserting a value"
[self.insert(i, True) for i in self.session.db[self.name]["items"][:num]] v = [i for i in self.session.db[self.name]["items"][:num]]
v.reverse()
[self.insert(i, True) for i in v]
else: else:
[self.insert(i) for i in self.session.db[self.name]["items"][:num]] [self.insert(i) for i in self.session.db[self.name]["items"][:num]]
else: else:
@ -124,7 +126,9 @@ class feedBuffer(baseBuffer):
if show_nextpage == False: if show_nextpage == False:
if self.tab.list.get_count() > 0 and num > 0: if self.tab.list.get_count() > 0 and num > 0:
print "inserting a value" print "inserting a value"
[self.insert(i, True) for i in self.session.db[self.name]["items"][-num:]] v = [i for i in self.session.db[self.name]["items"][:num]]
v.reverse()
[self.insert(i, True) for i in v]
else: else:
[self.insert(i) for i in self.session.db[self.name]["items"][:num]] [self.insert(i) for i in self.session.db[self.name]["items"][:num]]