示例#1
0
    def __init__(self, options={}):
        """Constructor

        options[in]        Array of options for controlling what is included
                           and how operations perform (e.g., verbose)
        """
        Console.__init__(self, _NEW_BASE_COMMANDS, options)
        try:
            from mysql.utilities.common.utilities import get_util_path
            path = get_util_path(options.get("utildir", ""))
            if path is None:
                raise
        except:
            raise UtilError(_UTILS_MISSING)
        self.utils = Utilities(options)
        if self.quiet:
            self.f_out = tempfile.NamedTemporaryFile(delete=False)
            print "Quiet mode, saving output to %s" % self.f_out.name
        else:
            self.f_out = None
    def __init__(self, options={}):
        """Constructor

        options[in]        Array of options for controlling what is included
                           and how operations perform (e.g., verbose)
        """
        Console.__init__(self, _NEW_BASE_COMMANDS, options)
        try:
            from mysql.utilities.common.utilities import get_util_path
            path =  get_util_path(options.get("utildir", ""))
            if path is None:
                raise
        except:
            raise UtilError(_UTILS_MISSING)
        self.utils = Utilities(options)
        if self.quiet:
            self.f_out = tempfile.NamedTemporaryFile(delete=False)
            print "Quiet mode, saving output to %s" % self.f_out.name
        else:
            self.f_out = None
    def __init__(self, options=None):
        """Constructor

        options[in]        Array of options for controlling what is included
                           and how operations perform (e.g., verbose)
        """
        if options is None:
            options = {}
        Console.__init__(self, _NEW_BASE_COMMANDS, options)
        try:
            self.path = get_util_path(options.get("utildir", ""))
            if self.path is None:
                raise
        except:
            raise UtilError(_UTILS_MISSING)
        self.utils = Utilities(options)
        self.errors = []
        if self.quiet:
            self.f_out = tempfile.NamedTemporaryFile(delete=False)
            print("Quiet mode, saving output to {0}".format(self.f_out.name))
        else:
            self.f_out = None