installer/windowstringreader.py
f4d17450
 #
 #
 #    Author: Mahmoud Bassiouny <mbassiouny@vmware.com>
 
 from window import Window
 from readtext import ReadText
 
 class WindowStringReader(object):
c533b308
     def __init__(self, maxy, maxx, height, width, field, confirmation_err_msg,
                  echo_char, accepted_chars, validation_fn, conversion_fn, title,
                  display_string, inputy, install_config, default_string=None,
                  tab_enabled=False):
f4d17450
         self.title = title
         self.display_string = display_string
3c4cf0da
         self.install_config = install_config
f4d17450
         self.inputy = inputy
 
         self.width = width
         self.height = height
         self.maxx = maxx
         self.maxy = maxy
 
a672bd24
         self.startx = (self.maxx - self.width) // 2
         self.starty = (self.maxy - self.height) // 2
c533b308
         self.tab_enabled = False
         self.can_go_next = True
f4d17450
 
c533b308
         self.window = Window(self.height, self.width, self.maxy, self.maxx, self.title,
                              True, tab_enabled=self.tab_enabled,
                              position=1, can_go_next=self.can_go_next, read_text=self.can_go_next)
         self.read_text = ReadText(maxy, maxx, self.window.content_window(), self.inputy,
                                   install_config,
                                   field, confirmation_err_msg, echo_char, accepted_chars,
                                   validation_fn,
                                   conversion_fn, default_string, tab_enabled=self.tab_enabled)
f4d17450
         self.window.set_action_panel(self.read_text)
         self.window.addstr(0, 0, self.display_string)
 
     def get_user_string(self, params):
         return self.window.do_action()