本文整理汇总了Python中common.Common.dialog_result方法的典型用法代码示例。如果您正苦于以下问题:Python Common.dialog_result方法的具体用法?Python Common.dialog_result怎么用?Python Common.dialog_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.Common
的用法示例。
在下文中一共展示了Common.dialog_result方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from common import Common [as 别名]
# 或者: from common.Common import dialog_result [as 别名]
help="Amount of parallel threads used to download files", default=5)
parser.add_argument('--prompt', '-p', help="Prompt before actually downloading anything", action="store_true")
args = parser.parse_args()
IO.IO.print_logo()
P = Project.Project(args)
try:
P.start()
except KeyboardInterrupt:
P.pause_signal = 1
print(os.linesep)
IO.IO.put("Ctrl+C or other interrupt caught.", "critical")
shutdown = IO.IO.get("Are you sure you want to cancel? [Y/n]")
result = Common.dialog_result(shutdown)
if result:
P.pause_signal = 0
P.shutdown_signal = 1
while threading.active_count() > 1:
for t in threading.enumerate():
IO.IO.put("Active: {}".format(t.name))
IO.IO.put("Waiting for all threads to shutdown gracefully...({} remaining)".format(threading.active_count()), "warning")
time.sleep(3)
else:
P.pause_signal = 0
except urllib.error.HTTPError as err:
P.log("exception", "HTTP ERROR {} - Response from server:\n{}".format(err.code, err.read().decode('utf-8')), "critical", True)
sys.exit(1)
except http.client.IncompleteRead: