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


Python System.getUserInput方法代码示例

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


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

示例1: authenticate_username_password

# 需要导入模块: from mcvirt.system import System [as 别名]
# 或者: from mcvirt.system.System import getUserInput [as 别名]
 def authenticate_username_password(self, args, ignore_cluster):
     """Authenticate using username and password"""
     # Check if user/password have been passed. Else, ask for them.
     username = args.username if args.username else System.getUserInput(
         'Username: '
     ).rstrip()
     if args.password:
         password = args.password
     else:
         password = System.getUserInput(
             'Password: ', password=True
         ).rstrip()
     self.rpc = Connection(username=username, password=password,
                           ignore_cluster=ignore_cluster)
     self.session_id = self.rpc.session_id
     self.username = self.rpc.username
开发者ID:ITDevLtd,项目名称:MCVirt,代码行数:18,代码来源:parser.py

示例2: handle_add

# 需要导入模块: from mcvirt.system import System [as 别名]
# 或者: from mcvirt.system.System import getUserInput [as 别名]
 def handle_add(self, p_, args):
     """Handle add of node"""
     cluster_object = p_.rpc.get_connection('cluster')
     if args.connect_string:
         connect_string = args.connect_string
     else:
         connect_string = System.getUserInput('Enter Connect String: ')
     cluster_object.add_node(connect_string)
     p_.print_status('Successfully added node')
开发者ID:ITDevLtd,项目名称:MCVirt,代码行数:11,代码来源:cluster_parser.py

示例3: check_ignore_failed

# 需要导入模块: from mcvirt.system import System [as 别名]
# 或者: from mcvirt.system.System import getUserInput [as 别名]
    def check_ignore_failed(self, args):
        """Check ignore failed"""
        if args.ignore_failed_nodes:
            # If the user has specified to ignore the cluster,
            # print a warning and confirm the user's answer
            if not args.accept_failed_nodes_warning:
                self.print_status(('WARNING: Running MCVirt with --ignore-failed-nodes'
                                   ' can leave the cluster in an inconsistent state!'))
                continue_answer = System.getUserInput('Would you like to continue? (Y/n): ')

                if continue_answer.strip() is not 'Y':
                    self.print_status('Cancelled...')
                    return
            return True
        return False
开发者ID:ITDevLtd,项目名称:MCVirt,代码行数:17,代码来源:parser.py


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