Beispiel #1
0
 def __init__(self, args=None, opts=None):
     super(OvirtCliExecutionContext, self).__init__(args=args, opts=opts)
     self.connection = None
     self.url = None
     self.formatter = create(Formatter, self.settings['ovirt-shell:output_format'])
     self.settings.add_callback('cli:verbosity', self._set_verbosity)
     self.settings.add_callback('ovirt-shell:output_format', self._set_formatter)
     self.product_info = None
     self.sdk_version, self.cli_version, self.backend_version = self.__get_version_info()
     self.history = HistoryManager()
     self.__capabilities = None
Beispiel #2
0
 def __init__(self, args=None, opts=None):
     super(OvirtCliExecutionContext, self).__init__(args=args, opts=opts)
     self.connection = None
     self.url = None
     self.formatter = create(Formatter,
                             self.settings['ovirt-shell:output_format'])
     self.settings.add_callback('cli:verbosity', self._set_verbosity)
     self.settings.add_callback('ovirt-shell:output_format',
                                self._set_formatter)
     self.product_info = None
     self.sdk_version, self.cli_version, self.backend_version = self.__get_version_info(
     )
     self.history = HistoryManager()
     self.__capabilities = None
Beispiel #3
0
def main():
    # Parse the command line:
    parser = create(OvirtCliOptionParser)
    opts, args = parser.parse_args()

    # Convert the options to a dictionary, so the rest of the code doesn't
    # have to deal with optparse specifics:
    opts = vars(opts)

    # Create the execution context:
    context = OvirtCliExecutionContext(opts=opts, args=args)

    # Create the command interpreter:
    shell = EngineShell(context)
    shell.onecmd_loop()
Beispiel #4
0
def main():
    # Parse the command line:
    parser = create(OvirtCliOptionParser)
    opts, args = parser.parse_args()

    # Convert the options to a dictionary, so the rest of the code doesn't
    # have to deal with optparse specifics:
    opts = vars(opts)

    # Create the execution context:
    context = OvirtCliExecutionContext(opts=opts, args=args)

    # Create the command interpreter:
    shell = EngineShell(context)
    shell.onecmd_loop()
Beispiel #5
0
 def _set_formatter(self, key, value):
     self.formatter = create(Formatter, value)
Beispiel #6
0
 def _set_formatter(self, key, value):
     self.formatter = create(Formatter, value)