certbot.compat.misc module
此compat模块处理各种不属于某一特定类别的特定于平台的调用。
certbot.compat.misc.``raise_for_non_administrative_windows_rights
()[source]
在Windows上,如果当前的shell没有管理权限,请提高。在Linux上什么也不做。
Raises: errors.Error – 如果当前shell在Windows上没有管理权限。
certbot.compat.misc.``readline_with_timeout
(timeout, prompt)[source]
读取用户输入以返回输入的第一行,或在指定的超时后升高。
Parameters:
- timeout (float) –给予用户的超时(以秒为单位)。
- prompt (str) –向用户显示的提示信息。
Returns: 用户输入的第一行。
Return type: str
certbot.compat.misc.``get_default_folder
(folder_type)[source]
返回当前操作系统的相关默认文件夹
Parameters: folder_type (str) – 要检索的文件夹的类型(配置,工作或日志)
Returns: 相关的默认文件夹。
Return type: str
certbot.compat.misc.underscores_for_unsupported_characters_in_path(path)source
用下划线替换当前操作系统路径中不受支持的字符。:param str path:归一化路径:return:归一化路径:rtype:str
certbot.compat.misc.execute_command(cmd_name, shell_cmd, env=None)source
运行命令:
- 在Linux上的命令将由通过Popen(shell = True)选择的标准shell运行
- Windows上的命令将在Powershell Shell中运行
Parameters:- cmd_name(str)–用户面对正在运行的钩子的名称
- shell_cmd(str)–要执行的shell命令
- env(dict)–传递给Popen的环境
Returns: tuple (str
stderr,str
stdout)