mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-31 05:10:45 -06:00
Merge branch 'next-gen' of manuelcortez.net:twblue/twblue into next-gen
This commit is contained in:
commit
4186f1a3e6
3
.gitignore
vendored
3
.gitignore
vendored
@ -16,4 +16,5 @@ src/Microsoft.VC90.CRT
|
||||
src/Microsoft.VC90.MFC
|
||||
src/launcher.bat
|
||||
src/sounds/iOs
|
||||
release-snapshot/
|
||||
release-snapshot/
|
||||
src/com_cache/
|
@ -360,6 +360,7 @@ class baseBufferController(bufferController):
|
||||
self.remove_item(i)
|
||||
|
||||
def put_items_on_list(self, number_of_items):
|
||||
if number_of_items == 0: return
|
||||
log.debug("The list contains %d items " % (self.buffer.list.get_count(),))
|
||||
log.debug("Putting %d items on the list" % (number_of_items,))
|
||||
if self.buffer.list.get_count() == 0:
|
||||
@ -369,13 +370,14 @@ class baseBufferController(bufferController):
|
||||
self.buffer.set_position(self.session.settings["general"]["reverse_timelines"])
|
||||
elif self.buffer.list.get_count() > 0:
|
||||
if self.session.settings["general"]["reverse_timelines"] == False:
|
||||
for i in self.session.db[self.name][:number_of_items]:
|
||||
items = self.session.db[self.name][len(self.session.db[self.name])-number_of_items:]
|
||||
for i in items:
|
||||
tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"])
|
||||
self.buffer.list.insert_item(False, *tweet)
|
||||
else:
|
||||
for i in self.session.db[self.name][0:number_of_items]:
|
||||
tweet = self.compose_function(i, self.session.db, self.session.settings["general"]["relative_times"])
|
||||
self.buffer.list.insert_item(True, *tweet)
|
||||
self.buffer.list.insert_item(False, *tweet)
|
||||
log.debug("Now the list contains %d items " % (self.buffer.list.get_count(),))
|
||||
|
||||
def add_new_item(self, item):
|
||||
@ -840,7 +842,7 @@ class peopleBufferController(baseBufferController):
|
||||
# self.buffer.set_list_position()
|
||||
elif self.buffer.list.get_count() > 0:
|
||||
if self.session.settings["general"]["reverse_timelines"] == False:
|
||||
for i in self.session.db[self.name]["items"][:number_of_items]:
|
||||
for i in self.session.db[self.name]["items"][len(self.session.db[self.name]["items"])-number_of_items:]:
|
||||
tweet = self.compose_function(i, self.session.db)
|
||||
self.buffer.list.insert_item(False, *tweet)
|
||||
else:
|
||||
|
@ -51,8 +51,10 @@ def compose_tweet(tweet, db, relative_times):
|
||||
user = tweet["user"]["name"]
|
||||
source = re.sub(r"(?s)<.*?>", "", tweet["source"])
|
||||
if tweet.has_key("retweeted_status"):
|
||||
if tweet.has_key("message") == False:
|
||||
if tweet.has_key("message") == False or tweet["retweeted_status"]["is_quote_status"] == False:
|
||||
text = "RT @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], StripChars(tweet["retweeted_status"]["text"]))
|
||||
elif tweet["retweeted_status"]["is_quote_status"]:
|
||||
text = "%s" % (StripChars(tweet[value]))
|
||||
else:
|
||||
text = "RT @%s: %s" % (tweet["retweeted_status"]["user"]["screen_name"], StripChars(tweet[value]))
|
||||
if text[-1] in chars: text=text+"."
|
||||
|
Loading…
x
Reference in New Issue
Block a user