mirror of
https://github.com/certbot/certbot.git
synced 2026-01-24 19:22:07 +03:00
augeas_configurator.py: E:220,12: Too many positional arguments for function call (too-many-function-args) client.py: E:628,18: Instance of 'Client' has no 'get_cas' member (no-member) interactive_challenge.py: E: 35,29: Instance of 'Interactive_Challenge' has no 'reason' member (no-member)
36 lines
997 B
Python
36 lines
997 B
Python
import textwrap
|
|
|
|
import dialog
|
|
|
|
from letsencrypt.client import challenge
|
|
|
|
|
|
###########################################################
|
|
# Interactive challenge displays the string sent by the CA
|
|
# formatted to fit on the screen of the client
|
|
# The Challenge also adds proper instructions for how the
|
|
# client should continue the letsencrypt process
|
|
###########################################################
|
|
|
|
class Interactive_Challenge(challenge.Challenge):
|
|
BOX_SIZE = 70
|
|
|
|
def __init__(self, string):
|
|
self.string = string
|
|
|
|
def perform(self, quiet=True):
|
|
if quiet:
|
|
dialog.Dialog().msgbox(self.get_display_string(), width=self.BOX_SIZE)
|
|
else:
|
|
print self.get_display_string()
|
|
raw_input('')
|
|
|
|
return True
|
|
|
|
|
|
def get_display_string(self):
|
|
return textwrap.fill(self.string, width=self.BOX_SIZE) + "\n\nPlease Press Enter to Continue"
|
|
|
|
# def formatted_reasons(self):
|
|
# return "\n\t* %s\n", self.reason
|