MCPcopy Create free account
hub / github.com/apache/solr / UserInput

Class UserInput

dev-tools/scripts/releaseWizard.py:1923–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1921 return lines
1922
1923class UserInput(SecretYamlObject):
1924 yaml_tag = u'!UserInput'
1925
1926 def __init__(self, name, prompt, type=None):
1927 self.type = type
1928 self.prompt = prompt
1929 self.name = name
1930
1931 @classmethod
1932 def from_yaml(cls, loader, node):
1933 fields = loader.construct_mapping(node, deep = True)
1934 return UserInput(**fields)
1935
1936 def run(self, dict=None):
1937 correct = False
1938 while not correct:
1939 try:
1940 result = str(input("%s : " % self.prompt))
1941 if self.type and self.type == 'int':
1942 result = int(result)
1943 correct = True
1944 except Exception as e:
1945 print("Incorrect input: %s, try again" % e)
1946 continue
1947 if dict:
1948 dict[self.name] = result
1949 return result
1950
1951
1952def create_ical(todo): # pylint: disable=unused-argument

Callers 1

from_yamlMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…