コード例 #1
0
 def postOptions_bind_mandatory(self):
     if not self.opts["binddn"]:
         raise usage.UsageError("binddn must be given")
コード例 #2
0
 def postOptions(self):
     if not self['jobdir']:
         raise usage.UsageError('jobdir is required')
コード例 #3
0
 def postOptions(self):
     super(LeaveOptions, self).postOptions()
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
コード例 #4
0
ファイル: tap.py プロジェクト: mpice-mn/python-opsi
 def opt_allow_ignore_ext(self):
     """Specify whether or not a request for 'foo' should return 'foo.ext'"""
     if not isinstance(self['root'], static.File):
         raise usage.UsageError("You can only use --allow_ignore_ext "
                                "after --path.")
     self['root'].ignoreExt('*')
コード例 #5
0
ファイル: _package.py プロジェクト: zealotous/mamba-framework
def mamba_services_not_found():
    raise usage.UsageError(
        'error: make sure you are inside a mamba application root directory '
        'and then run this command again'
    )
コード例 #6
0
ファイル: debug.py プロジェクト: jean/tahoe-lafs
 def parseArgs(self, *nodedirs):
     from allmydata.util.encodingutil import argv_to_abspath
     self.nodedirs = map(argv_to_abspath, nodedirs)
     if not nodedirs:
         raise usage.UsageError("must specify at least one node directory")
コード例 #7
0
ファイル: cli.py プロジェクト: byrgazov/foolscap
 def postOptions(self):
     if self["umask"] is None:
         self["umask"] = get_umask()
     if not self["location"]:
         raise usage.UsageError("--location= is mandatory")
コード例 #8
0
 def postOptions(self):
     if not self["location"]:
         raise usage.UsageError("--location= is mandatory")
コード例 #9
0
ファイル: web.py プロジェクト: byrgazov/foolscap
 def opt_timestamps(self, arg):
     if arg not in FORMAT_TIME_MODES:
         raise usage.UsageError("--timestamps= must be one of (%s)" %
                                ", ".join(FORMAT_TIME_MODES))
     self["timestamps"] = arg
コード例 #10
0
ファイル: tap2deb.py プロジェクト: Zhangrui19951107/whu_gs
 def postOptions(self):
     if not self["maintainer"]:
         raise usage.UsageError("maintainer must be specified.")
コード例 #11
0
ファイル: runner.py プロジェクト: cpelsser/tamias
    if config['quiet']:
        stdout = StringIO()

    so.stdout = stdout
    so.stderr = stderr
    so.stdin = stdin

    if command in create_dispatch:
        rc = create_dispatch[command](so, stdout, stderr)
    elif command in startstop_node.dispatch:
        rc = startstop_node.dispatch[command](so, stdout, stderr)
    elif command in debug.dispatch:
        rc = debug.dispatch[command](so)
    elif command in cli.dispatch:
        rc = cli.dispatch[command](so)
    elif command in ac_dispatch:
        rc = ac_dispatch[command](so, stdout, stderr)
    else:
        raise usage.UsageError()

    return rc


def run(install_node_control=True):
    if sys.platform == "win32":
        from allmydata.windows.fixups import initialize
        initialize()

    rc = runner(sys.argv[1:], install_node_control=install_node_control)
    sys.exit(rc)
コード例 #12
0
 def postOptions(self):
     MakerBase.postOptions(self)
     self['usepty'] = int(self['usepty'])
     self['keepalive'] = int(self['keepalive'])
     if self['master'].find(":") == -1:
         raise usage.UsageError("--master must be in the form host:portnum")
コード例 #13
0
 def postOptions(self):
     if self['basedir'] is None:
         raise usage.UsageError("<basedir> parameter is required")
     self['basedir'] = os.path.abspath(self['basedir'])
コード例 #14
0
 def postOptions_base(self):
     # check that some things are given
     if self.opts["base"] is None:
         raise usage.UsageError("base must be given")
コード例 #15
0
 def postOptions(self):
     if not self['basedir']:
         raise usage.UsageError(
             "A base directory for the node must be provided.")
コード例 #16
0
ファイル: cli.py プロジェクト: sspreitzer/tahoe-lafs
 def parseArgs(self, *args):
     if len(args) < 2:
         raise usage.UsageError("cp requires at least two arguments")
     self.sources = map(argv_to_unicode, args[:-1])
     self.destination = argv_to_unicode(args[-1])
コード例 #17
0
 def opt_version(self):
     raise usage.UsageError("--version not allowed on subcommands")
コード例 #18
0
 def postOptions(self):
     if self["suboptions"]:
         self.subOptions = "SubOptionUsage"
     raise usage.UsageError("usage-error-message")
コード例 #19
0
 def postOptions(self):
     if self['loud']:
         raise usage.UsageError('THIS IS ME BEING LOUD')
コード例 #20
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         raise usage.UsageError("must specify a subcommand")
     # ensure our node-directory is valid
     _ = self.node_directory
コード例 #21
0
ファイル: tap.py プロジェクト: hitzjd/Balance-Simulate
 def opt_mime_type(self, defaultType):
     """Specify the default mime-type for static files."""
     if not isinstance(self['root'], static.File):
         raise usage.UsageError(
             "You can only use --mime_type after --path.")
     self['root'].defaultType = defaultType
コード例 #22
0
 def postOptions(self):
     if self['web-port'] is None:
         raise usage.UsageError(
             "Must specify a listening endpoint with --web-port")
コード例 #23
0
ファイル: tap.py プロジェクト: mpice-mn/python-opsi
 def postOptions(self):
     if self['https']:
         try:
             from twisted.internet.ssl import DefaultOpenSSLContextFactory
         except ImportError:
             raise usage.UsageError("SSL support not installed")
コード例 #24
0
ファイル: runner.py プロジェクト: IbnNafis007/katana
 def parseArgs(self, *args):
     if len(args) > 0:
         self['master'] = args[0]
     if len(args) > 1:
         raise usage.UsageError("I wasn't expecting so many arguments")
コード例 #25
0
ファイル: runner.py プロジェクト: meetbill/tahoe-lafs
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         if not hasattr(self, 'no_command_needed'):
             raise usage.UsageError("must specify a command")
         sys.exit(0)
コード例 #26
0
 def parseOptions(self, arguments):
     raise usage.UsageError(expectedMessage)
コード例 #27
0
 def postOptions(self):
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
コード例 #28
0
ファイル: manhole_tap.py プロジェクト: MayuraVerma/Kannada
 def postOptions(self):
     if self['telnetPort'] is None and self['sshPort'] is None:
         raise usage.UsageError(
             "At least one of --telnetPort and --sshPort must be specified")
コード例 #29
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         raise usage.UsageError("must specify a subcommand")
コード例 #30
0
ファイル: options.py プロジェクト: sipior/Comet
 def postOptions(self):
     if not self['local-ivo'] and (self['broadcast'] or self['receive']):
         raise usage.UsageError("IVOA identifier required (--local-ivo)")