mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-05 03:12:29 -04:00
Added code to handle user timelines in buffer creator
This commit is contained in:
parent
a9a4189295
commit
4cabf5b9cd
@ -301,6 +301,15 @@ class Controller(object):
|
|||||||
if not hasattr(available_buffers, buffer_type):
|
if not hasattr(available_buffers, buffer_type):
|
||||||
raise AttributeError("Specified buffer type does not exist: %s" % (buffer_type,))
|
raise AttributeError("Specified buffer type does not exist: %s" % (buffer_type,))
|
||||||
buffer = getattr(available_buffers, buffer_type)(**kwargs)
|
buffer = getattr(available_buffers, buffer_type)(**kwargs)
|
||||||
|
if start:
|
||||||
|
if kwargs.get("function") == "user_timeline":
|
||||||
|
try:
|
||||||
|
buffer.start_stream(play_sound=False)
|
||||||
|
except ValueError:
|
||||||
|
commonMessageDialogs.unauthorized()
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
call_threaded(buffer.start_stream)
|
||||||
self.buffers.append(buffer)
|
self.buffers.append(buffer)
|
||||||
if parent_tab == None:
|
if parent_tab == None:
|
||||||
log.debug("Appending buffer {}...".format(buffer,))
|
log.debug("Appending buffer {}...".format(buffer,))
|
||||||
@ -308,8 +317,6 @@ class Controller(object):
|
|||||||
else:
|
else:
|
||||||
self.view.insert_buffer(buffer.buffer, buffer_title, parent_tab)
|
self.view.insert_buffer(buffer.buffer, buffer_title, parent_tab)
|
||||||
log.debug("Inserting buffer {0} into control {1}".format(buffer, parent_tab))
|
log.debug("Inserting buffer {0} into control {1}".format(buffer, parent_tab))
|
||||||
if start:
|
|
||||||
call_threaded(buffer.start_stream)
|
|
||||||
|
|
||||||
def create_buffers(self, session, createAccounts=True):
|
def create_buffers(self, session, createAccounts=True):
|
||||||
""" Generates buffer objects for an user account.
|
""" Generates buffer objects for an user account.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user