示例#1
0
文件: ui.py 项目: ornicar/vulug
class Ui(object):

    def __init__(self, term, config):
        self.term = term
        self.config = config

        height = self.term.get_height()
        width = self.term.get_width()

        self.container = Container(term, height, width)
        self.timeline = Timeline(term, height - 3, width - 4, 2, 2)
        self.status = Status(term, 1, width, height - 1, 0)

    def home(self, tweets):
        self.container.title('Home Timeline')
        self.timeline.set_tweets(tweets)
        self.unwait()

    def more(self, tweets):
        self.timeline.add_tweets(tweets)
        self.unwait()

    def wait(self):
        self.status.show('Retrieving data from twitter...')

    def unwait(self):
        self.status.show('')

    def get_key(self):
        return self.timeline.win.getch()
示例#2
0
文件: ui.py 项目: ornicar/vulug
    def __init__(self, term, config):
        self.term = term
        self.config = config

        height = self.term.get_height()
        width = self.term.get_width()

        self.container = Container(term, height, width)
        self.timeline = Timeline(term, height - 3, width - 4, 2, 2)
        self.status = Status(term, 1, width, height - 1, 0)