コード例 #1
0
ファイル: __init__.py プロジェクト: conordavis/scapy
 def _ask_user():
     if not conf.interactive:
         return False
     while True:
         _confir = input("Do you want to start it ? (yes/no) [y]: ").lower().strip()
         if _confir in ["yes", "y", ""]:
             return True
         elif _confir in ["no", "n"]:
             return False
     return False
コード例 #2
0
ファイル: __init__.py プロジェクト: dark-lbp/scapy
 def _ask_user():
     if not conf.interactive:
         return False
     while True:
         _confir = input("Do you want to start it ? (yes/no) [y]: ").lower().strip()
         if _confir in ["yes", "y", ""]:
             return True
         elif _confir in ["no", "n"]:
             return False
     return False
コード例 #3
0
 def _ask_user():
     if not conf.interactive:
         return False
     msg = "Do you want to start it ? (yes/no) [y]: "
     try:
         # Better IPython compatibility
         import IPython
         return IPython.utils.io.ask_yes_no(msg, default='y')
     except (NameError, ImportError):
         while True:
             _confir = input(msg)
             _confir = _confir.lower().strip()
             if _confir in ["yes", "y", ""]:
                 return True
             elif _confir in ["no", "n"]:
                 return False