当前位置: 首页>>代码示例>>Python>>正文


Python View.success_message方法代码示例

本文整理汇总了Python中view.View.success_message方法的典型用法代码示例。如果您正苦于以下问题:Python View.success_message方法的具体用法?Python View.success_message怎么用?Python View.success_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在view.View的用法示例。


在下文中一共展示了View.success_message方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __cinema_update_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import success_message [as 别名]
    def __cinema_update_controller(self):
        choice = -1
        try:
            id = int(raw_input('Enter id:\n'))
        except ValueError:
            View.error_message('Incorrect value')

        if  not self.model.is_exist(id, self.model.get_cinemas()):
            View.error_message('Incorrect id')
            return

        while choice != 3:
            View.cinemas_update_menu()
            try:
                choice = int(raw_input('Enter menu item:\n'))
            except ValueError:
                View.error_message('Incorrect value')

            if choice == 1:
                name = raw_input('Enter new cinema name:\n')
                self.model.cinema_update(id, 'name', name)
                View.success_message('Item successfuly updated!!!')

            elif choice == 2:
                street = raw_input('Enter new street:\n')
                self.model.cinema_update(id, 'street', street)
                View.success_message('Item successfuly updated!!!')

            raw_input('Press -->Enter...\n')
开发者ID:VladPodilnyk,项目名称:KVlabs,代码行数:31,代码来源:controller.py

示例2: __session_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import success_message [as 别名]
    def __session_controller(self):
        choice = -1
        while choice != 5:
            View.sessions_menu()
            try:
                choice = int(raw_input('Enter menu item:\n'))
            except ValueError:
                View.error_message('Incorrect value')

            if choice == 1:
                try:
                    name = raw_input('Enter session name:\n')
                    cost = float(raw_input('Enter session cost:\n'))
                    cinema_id = int(raw_input('Enter cinema_id:\n'))
                    time = raw_input('Enter time(hour:minutes):\n')
                    self.model.is_time_correct(time)
                    self.model.add_session(name, time, cost, cinema_id)
                    View.success_message('Item successfuly added!!!')
                except ValueError:
                    View.error_message('Incorrect value')
                except Exception as e:
                    View.error_message(e.message)

            elif choice == 2:
                try:
                    id = int(raw_input('Enter id:\n'))
                except ValueError:
                    View.error_message('Incorrect value')

                if not self.model.is_exist(id, self.model.get_sessions()):
                    View.error_message('Incorrect id')
                    return

                self.model.del_session(id)
                View.success_message('Item successfuly deleted!!!')

            elif choice == 3:
                self.__session_update_controller()

            elif choice == 4:
                View.display(self.model.get_sessions())

        raw_input('Press -->Enter...\n')
开发者ID:VladPodilnyk,项目名称:KVlabs,代码行数:45,代码来源:controller.py

示例3: __cinema_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import success_message [as 别名]
    def __cinema_controller(self):
        choice = -1
        while choice != 6:
            View.cinemas_menu()
            try:
                choice = int(raw_input('Enter menu item:\n'))
            except ValueError:
                View.error_message('Incorrect value')

            if choice == 1:
                name = raw_input('Enter cinema name:\n')
                street = raw_input('Enter street:\n')
                self.model.add_cinema(name, street)
                View.success_message('Item successfuly added!!!')
            elif choice == 2:
                try:
                    id = int(raw_input('Enter id:\n'))
                except ValueError:
                    View.error_message('Incorrect value\n')

                if not  self.model.is_exist(id, self.model.get_cinemas()):
                    View.error_message('Incorrect id')
                    return

                self.model.delete_cinema(id)
                View.success_message('Item successfuly deleted!!!')

            elif choice == 3:
                self.__cinema_update_controller()

            elif choice == 4:
                View.display(self.model.cinema_time(18))

            elif choice == 5:
                View.display(self.model.get_cinemas())

        raw_input('Press -->Enter...\n')
开发者ID:VladPodilnyk,项目名称:KVlabs,代码行数:39,代码来源:controller.py

示例4: __session_update_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import success_message [as 别名]
    def __session_update_controller(self):
        choice = -1
        try:
            id = int(raw_input('Enter id:\n'))
        except ValueError:
            View.error_message('Incorrect value')

        if  not self.model.is_exist(id, self.model.get_sessions()):
            View.error_message('Incorrect id')
            return

        while choice != 4:
            View.sessions_update_menu()
            try:
                choice = int(raw_input('Enter menu item:\n'))
            except ValueError:
                View.error_message('Incorrect value')

            if choice == 1:
                name = raw_input('Enter new session name:\n')
                self.model.session_update(id, 'name', name)
                View.success_message('Item successfuly updated!!!')

            elif choice == 2:
                try:
                    time = raw_input('Enter time:\n')
                    self.model.is_time_correct(time)
                    self.model.session_update(id, 'time', time)
                    View.success_message('Item successfuly updated!!!')
                except Exception as e:
                    View.error_message(e.message)

            elif choice == 3:
                try:
                    cost = float(raw_input('Enter cost:\n'))
                    self.model.session_update(id, 'cost', cost)
                    View.success_message('Item successfuly updated!!!')
                except ValueError:
                    View.error_message('Incorrect value')

            raw_input('Press -->Enter...\n')
开发者ID:VladPodilnyk,项目名称:KVlabs,代码行数:43,代码来源:controller.py


注:本文中的view.View.success_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。