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


Python View.display方法代码示例

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


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

示例1: __cinema_menu_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import display [as 别名]
    def __cinema_menu_controller(self):
        choice = -1
        while choice != 6:
            View.cinema_menu()
            try:
                choice = int(raw_input('Input:\n'))
            except ValueError:
                View.error_view('Incorrect value')

            if choice == 1:
                name = raw_input('Enter cinema name:\n')
                street = raw_input('Enter cinema street:\n')
                self.model.add_cinema(name, street)
                View.success_view('added')
            elif choice == 2:
                try:
                    id = int(raw_input('Enter item id:\n'))
                except ValueError:
                    View.error_view('Incorrect value')

                if not self.model.is_cinema_exist(id):
                    View.error_view('No item with given id')
                else:
                    self.model.del_cinema(id)
                    View.success_view('removed')
            elif choice == 3:
                self.__cinema_update_controller()
            elif choice == 4:
                View.display(self.model.get_cinema_list())
            elif choice == 5:
                View.display(self.model.session_after_hour(18))
            raw_input('Press any key')
开发者ID:prihodkoserzh,项目名称:KPI,代码行数:34,代码来源:controller.py

示例2: __session_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import display [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: __session_menu_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import display [as 别名]
    def __session_menu_controller(self):
        choice = -1
        while choice != 5:
            View.session_menu()
            try:
                choice = int(raw_input('Input:\n'))
            except ValueError:
                View.error_view('Incorrect value')

            if choice == 1:
                try:
                    name = raw_input('Enter session name:\n')
                    cost = int(raw_input('Enter price for session:\n'))
                    time = int(raw_input('Enter hour:\n'))
                    cinema_id = int(raw_input('Enter id of cinema:\n'))
                    self.model.add_session(name, cost, time, cinema_id)
                    View.success_view('added')
                except ValueError:
                    View.error_view('Incorrect value')
                except Exception as e:
                    View.error_view(e.message)

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

                if not self.model.is_session_exist(id):
                    View.error_view('No item with given id')
                else:
                    self.model.del_session(id)
                    View.success_view('removed')
            elif choice == 3:
                self.__session_update_controller()
            elif choice == 4:
                View.display(self.model.get_session_list())

            raw_input('Press any key')
开发者ID:prihodkoserzh,项目名称:KPI,代码行数:41,代码来源:controller.py

示例4: __cinema_controller

# 需要导入模块: from view import View [as 别名]
# 或者: from view.View import display [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


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