Пример #1
0
 def do_source(self, line):
    action = ParmedActions.source(self.parm, line)
    self.stdout.write('%s\n' % action)
    _cmd = ParmedCmd(self.parm, stdin=open(action.filename, 'r'),
                     stdout=self.stdout)
    _cmd.prompt = ''
    _cmd.interpreter = self.interpreter
    _cmd.use_rawinput = 0
    _cmd.cmdloop()
Пример #2
0
 def do_source(self, line):
     action = ParmedActions.source(self.parm, line)
     self.stdout.write('%s\n' % action)
     _cmd = ParmedCmd(self.parm, stdin=open(action.filename, 'r'),
                      stdout=self.stdout)
     _cmd.prompt = ''
     _cmd.interpreter = self.interpreter
     _cmd.use_rawinput = 0
     # If we exit on error, call cmdloop without try protection. Otherwise,
     # we need to protect cmdloop to catch any ParmError's that are passed
     # through to avoid exiting the top-level interpreter
     if self._exit_on_fatal:
         _cmd.cmdloop()
     else:
         # If we are not exiting on error, just ignore these parm errors
         # since they've already been printed. Now just wait for the next
         # command from the user.
         try:
             _cmd.cmdloop()
         except ParmError:
             pass