• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(83)  |  Call(26)  |  Derive(3)  |  Import(54)
Raised if an Option instance is created with invalid or
inconsistent arguments.

src/z/a/zamboni-lib-HEAD/lib/python/logilab/common/optik_ext.py   zamboni-lib(Download)
from os.path import exists
 
# python >= 2.3
from optparse import OptionParser as BaseParser, Option as BaseOption, \
     OptionGroup, OptionContainer, OptionValueError, OptionError, \
     Values, HelpFormatter, NO_DEFAULT, SUPPRESS_HELP
 
    def _check_choice(self):
        """FIXME: need to override this due to optik misdesign"""
        if self.type in ("choice", "multiple_choice"):
            if self.choices is None:
                raise OptionError(
                    "must supply a list of choices for type 'choice'", self)
            elif type(self.choices) not in (types.TupleType, types.ListType):
                raise OptionError(
                    "choices must be a list of strings ('%s' supplied)"
                    % str(type(self.choices)).split("'")[1], self)
        elif self.choices is not None:
            raise OptionError(
                "must not supply choices for type %r" % self.type, self)

src/l/o/logilab-common-0.52.0/optik_ext.py   logilab-common(Download)
from os.path import exists
 
# python >= 2.3
from optparse import OptionParser as BaseParser, Option as BaseOption, \
     OptionGroup, OptionContainer, OptionValueError, OptionError, \
     Values, HelpFormatter, NO_DEFAULT, SUPPRESS_HELP
 
    def _check_choice(self):
        """FIXME: need to override this due to optik misdesign"""
        if self.type in ("choice", "multiple_choice"):
            if self.choices is None:
                raise OptionError(
                    "must supply a list of choices for type 'choice'", self)
            elif type(self.choices) not in (types.TupleType, types.ListType):
                raise OptionError(
                    "choices must be a list of strings ('%s' supplied)"
                    % str(type(self.choices)).split("'")[1], self)
        elif self.choices is not None:
            raise OptionError(
                "must not supply choices for type %r" % self.type, self)

src/s/u/Sunflower-1.1.0/sunflower/_optparse.py   Sunflower(Download)
# Copyright 2007 Michael M. Hoffman <hoffman+software@ebi.ac.uk>
 
from collections import defaultdict
from optparse import (Option as _Option, OptionError,
                      OptionGroup as _OptionGroup,
                      OptionParser as _OptionParser, OptionValueError)
import sys
    def _check_const(self):
        if self.action not in self.CONST_ACTIONS and self.const is not None:
            msg = "'const' must not be supplied for action %r" % self.action
            raise OptionError(msg, self)
 
    def _check_nargs(self):
        nargs_limit = self.NARGS_SPECIFIED_ACTIONS[self.action]
        elif self.nargs != nargs_limit:
            msg = "'nargs' must be %d for action %r" % (nargs_limit,
                                                        self.action)
            raise OptionError(msg, self)
 
    CHECK_METHODS = [_Option._check_action,
                     _Option._check_type,

src/o/p/optplus-0.1.1/optplus/__init__.py   optplus(Download)
# Copyright 2007-2009 Michael M. Hoffman <hoffman+software@ebi.ac.uk>
 
from collections import defaultdict
from optparse import (Option as _Option, OptionError,
                      OptionGroup as _OptionGroup,
                      OptionParser as _OptionParser, OptionValueError)
import sys
    def _check_const(self):
        if self.action not in self.CONST_ACTIONS and self.const is not None:
            msg = "'const' must not be supplied for action %r" % self.action
            raise OptionError(msg, self)
 
    def _check_nargs(self):
        nargs_limit = self.NARGS_SPECIFIED_ACTIONS[self.action]
        elif self.nargs != nargs_limit:
            msg = "'nargs' must be %d for action %r" % (nargs_limit,
                                                        self.action)
            raise OptionError(msg, self)
 
    CHECK_METHODS = [_Option._check_action,
                     _Option._check_type,

src/p/y/pybloglines-HEAD/bloglines/settings.py   pybloglines(Download)
  from cStringIO import StringIO
except:
  from StringIO import StringIO
from optparse import OptionParser, OptionError
 
__copyright___ = """
  Copyright 2008 Andrew Robinson <arobinson74@users.sourceforge.net>
      d = self.validateSetting(opt.dest, self.get(opt.dest))
      if not d['valid']:
        if raiseError:
          raise OptionError(d['msg'], \
            '--' + opt.dest.replace('_', '-'))
        else:
          errors[opt.dest] = d['msg']

src/p/y/pygobject-HEAD/glib/option.py   pygobject(Download)
 
import sys
import optparse
from optparse import OptParseError, OptionError, OptionValueError, \
                     BadOptionError, OptionConflictError
 
if sys.version_info >= (3, 0):
    def _set_opt_string(self, opts):
        if self.REMAINING in opts:
            self._long_opts.append(self.REMAINING)
        optparse.Option._set_opt_string(self, opts)
        if len(self._short_opts) > len(self._long_opts):
            raise OptionError("goption.Option needs more long option names "
                              "than short option names")

src/c/l/clonedigger-HEAD/trunk/clonedigger/logilab/common/optik_ext.py   clonedigger(Download)
 
try:
    # python >= 2.3
    from optparse import OptionParser as BaseParser, Option as BaseOption, \
         OptionGroup, OptionValueError, OptionError, Values, HelpFormatter, \
         NO_DEFAULT
except ImportError:

src/c/l/clonedigger-HEAD/pretty_printing/clonedigger/logilab/common/optik_ext.py   clonedigger(Download)
 
try:
    # python >= 2.3
    from optparse import OptionParser as BaseParser, Option as BaseOption, \
         OptionGroup, OptionValueError, OptionError, Values, HelpFormatter, \
         NO_DEFAULT
except ImportError:

src/c/l/clonedigger-HEAD/for_evalution/clonedigger/logilab/common/optik_ext.py   clonedigger(Download)
 
try:
    # python >= 2.3
    from optparse import OptionParser as BaseParser, Option as BaseOption, \
         OptionGroup, OptionValueError, OptionError, Values, HelpFormatter, \
         NO_DEFAULT
except ImportError:

src/c/l/clonedigger-HEAD/clonedigger/logilab/common/optik_ext.py   clonedigger(Download)
 
try:
    # python >= 2.3
    from optparse import OptionParser as BaseParser, Option as BaseOption, \
         OptionGroup, OptionValueError, OptionError, Values, HelpFormatter, \
         NO_DEFAULT
except ImportError:

  1 | 2 | 3 | 4 | 5 | 6  Next