def actions_handler(self):
        action = input(settings.action_promt)

        if action == '1':
            if self.creator.response.is_valid():
                alrt = 'Post is created!'
                alerter = session.get_alerter()
                alerter.schedule_alert(alrt)
                ramdb.save(self.creator.newpost)
                return pp.PostPage()
            else:
                lib.print_alert(self.creator.response.get_message())
                return self.actions_handler()
        elif action == '2':
            return pp.PostPage()
        else:
            print('Invalid input!')
            return self.actions_handler()
    def actions_handler(self):
        action = input(settings.action_promt)

        if action == '1':
            if self.currentpage != 1:
                self.currentpage -= 1
            return pp.PostPage(currentpage=self.currentpage)
        elif action == '2':
            if self.currentpage != self.num:
                self.currentpage += 1
            return pp.PostPage(currentpage=self.currentpage)
        elif action == '3':
            return cp.CreatePostPage()
        elif action == '4':
            return up.UpdatePostPage()
        elif action == '5':
            return dp.DeletePostPage()
        elif action == '6':
            self.currentpage = 1
            return profp.ProfilePage()
        else:
            print('Invalid input!')
            return self.actions_handler()
    def actions_handler(self):
        action = input(settings.action_promt)

        if action == '1':
            if self.currentpage != 1:
                self.currentpage -= 1
            return up.UpdatePostPage(currentpage=self.currentpage)
        elif action == '2':
            if self.currentpage != self.num:
                self.currentpage += 1
            return up.UpdatePostPage(currentpage=self.currentpage)
        elif action == '3':
            if self.user.posts:
                self.is_typing = True
            else:
                print('There is no posts!')
                return self.actions_handler()
            return up.UpdatePostPage(currentpage=self.currentpage,
                                     is_typing=self.is_typing)
        elif action == '4':
            if self.user.posts and self.creator:
                if self.creator.response.is_valid():
                    ramdb.update(self.creator.get_post(), self.oldpost)
                    alerter = session.get_alerter()
                    alerter.schedule_alert('Post was updated!')
                    return pp.PostPage()
                else:
                    lib.print_alert(self.creator.response.get_message())
                    return self.actions_handler()

            print('Nothing to save!')
            return self.actions_handler()
        elif action == '5':
            return pp.PostPage()
        else:
            print('Invalid input!')
            return self.actions_handler()
    def actions_handler(self):
        action = input(settings.action_promt)

        if action == '1':
            if self.currentpage != 1:
                self.currentpage -= 1
            return dp.DeletePostPage(currentpage=self.currentpage)
        elif action == '2':
            if self.currentpage != self.num:
                self.currentpage += 1
            return dp.DeletePostPage(currentpage=self.currentpage)
        elif action == '3':
            if self.user.posts:
                self.is_typing = True
            else:
                print('There is no posts!')
                return self.actions_handler()
            return dp.DeletePostPage(currentpage=self.currentpage,
                                     is_typing=self.is_typing)
        elif action == '4':
            alerter = session.get_alerter()
            if self.user.posts:
                if self.select != -1:
                    alerter.schedule_alert('Post was deleted!')
                    ramdb.remove('posts', int(self.select))
                    return pp.PostPage()
                else:
                    print('Nothing is selected!')
                    return self.actions_handler()
            else:
                print('Nothing to delete!')
                return self.actions_handler()
        elif action == '5':
            return pp.PostPage()
        else:
            print('Invalid input!')
            return self.actions_handler()
    def actions_handler(self):
        action = input(settings.action_promt)

        if action == '1':
            return pp.PostPage()
        elif action == '2':
            return hp.HomePage()
        elif action == '3':
            session.clear()
            alerter = session.get_alerter()
            alerter.schedule_alert('Logged out!')
            return sp.StartPage()
        else:
            print('Invalid input!')
            return self.actions_handler()