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 (strstderr,strstdout)
Certbot中文文檔