Exemple #1
0
 def get_endidx ( self ):
     if util.isPlatformWindows ():
         import pyreadline
         return Readline ().get_endidx ()
     else:
         import readline
         return readline.get_endidx ()
Exemple #2
0
 def get_endidx(self):
     if util.isPlatformWindows():
         import pyreadline
         return Readline().get_endidx()
     else:
         import readline
         return readline.get_endidx()
Exemple #3
0
 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 )
Exemple #4
0
    def get_line_buffer ( self ):
        if util.isPlatformWindows ():
            import pyreadline
            return Readline ().get_line_buffer ()
        else:
            import readline
	    return readline.get_line_buffer()
Exemple #5
0
 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 )
Exemple #6
0
 def redisplay ( self ):
     if util.isPlatformWindows ():
         import pyreadline
         Readline ().redisplay ()
     else:
         import readline
         readline.redisplay ()
Exemple #7
0
 def insert_text(self, line):
     if util.isPlatformWindows():
         import pyreadline
         Readline().insert_text(line)
     else:
         import readline
         readline.insert_text(line)
Exemple #8
0
 def set_completer ( self, comp_func ):
     if util.isPlatformWindows ():
         import pyreadline
         Readline ().set_completer ( comp_func )
     else:
         import readline
         readline.set_completer ( comp_func )
Exemple #9
0
 def insert_text ( self, line ):
     if util.isPlatformWindows ():
         import pyreadline
         Readline ().insert_text ( line )
     else:
         import readline
         readline.insert_text ( line )
Exemple #10
0
 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)
Exemple #11
0
 def redisplay(self):
     if util.isPlatformWindows():
         import pyreadline
         Readline().redisplay()
     else:
         import readline
         readline.redisplay()
Exemple #12
0
 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)
Exemple #13
0
 def set_completer(self, comp_func):
     if util.isPlatformWindows():
         import pyreadline
         Readline().set_completer(comp_func)
     else:
         import readline
         readline.set_completer(comp_func)
Exemple #14
0
 def get_completer(self):
     if util.isPlatformWindows():
         import pyreadline
         return Readline().get_completer()
     else:
         import readline
         return readline.get_completer
Exemple #15
0
 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')
Exemple #16
0
 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')
Exemple #17
0
 def do_clear ( self, *args ):
     if util.isPlatformWindows ():
         os.system ( 'cls' )
     else:
         os.system ( 'clear' )
Exemple #18
0
 def do_clear(self, *args):
     if util.isPlatformWindows():
         os.system('cls')
     else:
         os.system('clear')