def build(self): matrix = SETTINGS['matrix'] self.icon = './res/img/icon.png' try: transition = globals()[SETTINGS['ui']['screen-transition'] ["transitions"][0]] direction = SETTINGS['ui']['screen-transition']['direction'][0] except: transition = NoTransition direction = 'up' root = ScreenManager(transition=transition(direction=direction)) root.fullscreen = False root.orientation = "portrait" root.user_id = matrix['user_id'] root.password = matrix['password'] root.default_room_alias = matrix['default_room_alias'] root.server = matrix['server'] root.predefined_rooms = matrix['predefined_rooms'] all_rooms = [root.default_room_alias] + root.predefined_rooms try: root.client, root.access_token = net.sign_in_matrix( root.server, root.user_id, root.password) root.add_widget(PublicRoomsList(app=root)) except net.API.MatrixRequestError, err: pass #raise err#sys.exit(err)
def build(self): sm = ScreenManager() sm.client = Client(None, None) login_screen = LoginScreen(name='login') login_screen.register_handlers(sm.client) register_screen = RegisterScreen(name='register') register_screen.register_handlers(sm.client) chat_screen = ChatScreen(name='chat') chat_screen.register_handlers(sm.client) sm.add_widget(login_screen) sm.add_widget(register_screen) sm.add_widget(chat_screen) Clock.schedule_interval(sm.client.update, 1.0 / 10.0) return sm
def build(self): matrix = SETTINGS['matrix'] self.icon = './res/img/icon.png' try: transition = globals()[SETTINGS['ui']['screen-transition']["transitions"][0]] direction = SETTINGS['ui']['screen-transition']['direction'][0] except: transition = NoTransition direction = 'up' root = ScreenManager(transition=transition(direction=direction)) root.fullscreen = False root.orientation = "portrait" root.user_id = matrix['user_id'] root.password = matrix['password'] root.default_room_alias = matrix['default_room_alias'] root.server = matrix['server'] root.predefined_rooms = matrix['predefined_rooms'] all_rooms = [root.default_room_alias] + root.predefined_rooms try: root.client, root.access_token = net.sign_in_matrix(root.server, root.user_id, root.password) root.add_widget(PublicRoomsList(app=root)) except net.API.MatrixRequestError, err: pass#raise err#sys.exit(err)