def get_endidx ( self ): if util.isPlatformWindows (): import pyreadline return Readline ().get_endidx () else: import readline return readline.get_endidx ()
def get_endidx(self): if util.isPlatformWindows(): import pyreadline return Readline().get_endidx() else: import readline return readline.get_endidx()
def parse_and_bind ( self, complete_key ): if util.isPlatformWindows (): import pyreadline Readline ().parse_and_bind ( complete_key ) else: import readline readline.parse_and_bind ( complete_key )
def get_line_buffer ( self ): if util.isPlatformWindows (): import pyreadline return Readline ().get_line_buffer () else: import readline return readline.get_line_buffer()
def set_completion_display_matches_hook ( self, function ): if util.isPlatformWindows (): import pyreadline Readline ().set_completion_display_matches_hook ( function ) else: import readline readline.set_completion_display_matches_hook ( function )
def redisplay ( self ): if util.isPlatformWindows (): import pyreadline Readline ().redisplay () else: import readline readline.redisplay ()
def insert_text(self, line): if util.isPlatformWindows(): import pyreadline Readline().insert_text(line) else: import readline readline.insert_text(line)
def set_completer ( self, comp_func ): if util.isPlatformWindows (): import pyreadline Readline ().set_completer ( comp_func ) else: import readline readline.set_completer ( comp_func )
def insert_text ( self, line ): if util.isPlatformWindows (): import pyreadline Readline ().insert_text ( line ) else: import readline readline.insert_text ( line )
def parse_and_bind(self, complete_key): if util.isPlatformWindows(): import pyreadline Readline().parse_and_bind(complete_key) else: import readline readline.parse_and_bind(complete_key)
def redisplay(self): if util.isPlatformWindows(): import pyreadline Readline().redisplay() else: import readline readline.redisplay()
def set_completion_display_matches_hook(self, function): if util.isPlatformWindows(): import pyreadline Readline().set_completion_display_matches_hook(function) else: import readline readline.set_completion_display_matches_hook(function)
def set_completer(self, comp_func): if util.isPlatformWindows(): import pyreadline Readline().set_completer(comp_func) else: import readline readline.set_completer(comp_func)
def get_completer(self): if util.isPlatformWindows(): import pyreadline return Readline().get_completer() else: import readline return readline.get_completer
def getTemplate(self): ''' Finds template based on o/s on which OpenClos is running and 1stage/2stage ZTP process returns: jinja2 template ''' if util.isPlatformUbuntu(): if util.isZtpStaged(self.__conf): return self.templateEnv.get_template('ubuntu.2stage.dhcp.conf') else: return self.templateEnv.get_template('ubuntu.1stage.dhcp.conf') elif util.isPlatformCentos(): if util.isZtpStaged(self.__conf): return self.templateEnv.get_template('centos.2stage.dhcp.conf') else: return self.templateEnv.get_template('centos.1stage.dhcp.conf') elif util.isPlatformWindows(): ''' this code is for testing only, generated dhcpd.conf would not work on windows ''' if util.isZtpStaged(self.__conf): return self.templateEnv.get_template('ubuntu.2stage.dhcp.conf') else: return self.templateEnv.get_template('ubuntu.1stage.dhcp.conf')
def do_clear ( self, *args ): if util.isPlatformWindows (): os.system ( 'cls' ) else: os.system ( 'clear' )
def do_clear(self, *args): if util.isPlatformWindows(): os.system('cls') else: os.system('clear')