def viewThread(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) url = button.get_label().split(':')[2] items = url.split('/') log.debug(items) ch.routeCommand('thread' + ' /' + items[3] + '/ ' + items[5].split('.')[0])
def unwatchThread(self, button): url = button.get_label().split(':')[2] for u in self.uvm.watched.keys(): if url in u: del self.uvm.watched[u] break from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('view watcher')
def __init__(self): self.mode = MODE.NORMAL self.stickies = STICKIES.HIDE self.cfg = Config() self.site = SITE[self.cfg.get('SITE')] self.boardList = self.cfg.get(self.site.name)['boards'] self.commandHandler = CommandHandler(self) self.commandBar = CommandBar(lambda: self._update_focus(True), self) urwid.connect_signal(self.commandBar, 'command_entered', self.commandHandler.routeCommand) urwid.connect_signal(self.commandBar, 'exit_command', self.exitCommand) self.history = collections.deque([], 50) self.palette = [('body', 'light gray', 'black', 'standout'), ('quote', 'light cyan', 'black'), ('greenText', 'dark green', 'black'), ('header', 'white', 'dark red', 'bold'), ('quotePreview', 'light gray', 'black')] # use appropriate Screen class if urwid.web_display.is_web_request(): self.screen = urwid.web_display.Screen() else: self.screen = urwid.raw_display.Screen() self.buildSetStartView() self.body = None self.splitTuple = self.currFocusView self.buildAddHeaderView(self.currFocusView) self.buildAddFooterView(self.currFocusView)
def __init__(self, test=False): self.mode = MODE.NORMAL self.stickies = STICKIES.HIDE self.cfg = Config() self.test = test self.mL = None self.commandHandler = CommandHandler(self) self.commandBar = CommandBar(lambda: self._update_focus(True), self) urwid.connect_signal(self.commandBar, 'command_entered', self.commandHandler.routeCommand) urwid.connect_signal(self.commandBar, 'exit_command', self.exitCommand) self.idList = [] self.history = [] self.watched = {} self.totalNewPosts = 0 self.palette = [('body', 'light gray', 'black', 'standout'), ('quote', 'light cyan', 'black'), ('greenText', 'dark green', 'black'), ('header', 'white', 'dark red', 'bold'), ('quotePreview', 'light gray', 'black')] # use appropriate Screen class if urwid.web_display.is_web_request(): self.screen = urwid.web_display.Screen() else: self.screen = urwid.raw_display.Screen() self.buildSetStartView() self.body = None self.splitTuple = self.currFocusView self.buildAddHeaderView(self.currFocusView) self.buildAddFooterView(self.currFocusView)
def restore(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('history ' + button.get_label()[0])
def changeStoryPage(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('story ' + self.story + ' ' + button.get_label())
def changeFrameThread(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('hnp ' + self.story + ' ' + button.get_label())
def changeFrameBoard(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('story ' + button.get_label() + ' ' + '0')
def changeSubPage(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('subpage ' + self.boardString + ' ' + button.get_label())
def changeFrameThread(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('post ' + self.boardString + ' ' + button.get_label())
def changeSubPage(self, button): from commandHandlerClass import CommandHandler ch = CommandHandler(self.uvm) ch.routeCommand('sub ' + self.subreddit + ' ' + button.get_label())