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

All Samples(55)  |  Call(7)  |  Derive(0)  |  Import(48)
Raised if an invalid option is seen on the command line.

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):
            if error.code == _glib.OPTION_ERROR_BAD_VALUE:
                raise OptionValueError(error.message)
            elif error.code == _glib.OPTION_ERROR_UNKNOWN_OPTION:
                raise BadOptionError(error.message)
            elif error.code == _glib.OPTION_ERROR_FAILED:
                raise OptParseError(error.message)
            else:

src/p/y/pyalbum-HEAD/trunk/pyalbum/AlbumOptions.py   pyalbum(Download)
 
import os, sys
from copy import copy
from optparse import Option, OptionValueError, OptionParser, OptionGroup, _match_abbrev, BadOptionError
from AlbumBase import VERSION, EXCLUDEDIRS, CONFIGFILE, OUTPUTDIR, \
     TEMPLATEFILENAME, OPTSOURCES, DEFEXTPICTURE, DEFEXTMOVIE, DEFEXTSOUND
 
    def take_action (self, action, dest, opt, value, values, parser):
        # extended version :-)
        if not self._sourceType in self.allowed:
            raise BadOptionError("Option '%s' not allowed in context '%s'" % (self.dest, self._sourceType))
 
        if self._sourceType == "cmdline":
            self._fromCmdLine = True # freeze this option!

src/p/y/pyalbum-HEAD/pyalbum/AlbumOptions.py   pyalbum(Download)
 
import os, sys
from copy import copy
from optparse import Option, OptionValueError, OptionParser, OptionGroup, _match_abbrev, BadOptionError
from AlbumBase import VERSION, EXCLUDEDIRS, CONFIGFILE, OUTPUTDIR, \
     TEMPLATEFILENAME, OPTSOURCES, DEFEXTPICTURE, DEFEXTMOVIE, DEFEXTSOUND
 
    def take_action (self, action, dest, opt, value, values, parser):
        # extended version :-)
        if not self._sourceType in self.allowed:
            raise BadOptionError("Option '%s' not allowed in context '%s'" % (self.dest, self._sourceType))
 
        if self._sourceType == "cmdline":
            self._fromCmdLine = True # freeze this option!

src/p/y/PyMetrics-HEAD/PyMetrics/processargs.py   PyMetrics(Download)
__author__ = 'Reg. Charney <pymetrics@charneyday.com>'
 
import sys
from optparse import OptionParser, BadOptionError
from doctestsw import *
 
usageStr = """python PyMetrics [ options ] pgm1.py [ pgm2.py ... ]
  def error( self, msg ):
    """ Explicitly raise BadOptionError so calling program can handle it."""
    raise BadOptionError( msg )
 
class ProcessArgsError( Exception ): pass
 
class ProcessArgs( object ):

src/c/t/ctypesgen-0.r120/ctypesgen.py   ctypesgen(Download)
def option_callback_W(option, opt, value, parser):
    # Options preceded by a "-Wl," are simply treated as though the "-Wl,"
    # is not there? I don't understand the purpose of this code...
    if len(value) < 4 or value[0:3] != 'l,-':
        raise optparse.BadOptionError("not in '-Wl,<opt>' form: %s%s"
                                      % (opt, value))
    opt = value[2:]
    if opt not in ['-L', '-R', '--rpath']:
        raise optparse.BadOptionError("-Wl option must be -L, -R"

src/m/e/metrics-0.1a3/metrics/processargs.py   metrics(Download)
""" Process command line arguments.
 
"""
__author__ = 'Mark Fink <mark@mark-fink.de>'
 
import sys
from optparse import OptionParser, BadOptionError
  def error( self, msg ):
    """ Explicitly raise BadOptionError so calling program can handle it."""
    raise BadOptionError( msg )
 
class ProcessArgsError( Exception ): pass
 
class ProcessArgs( object ):