示例#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
 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
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
 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
 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")
 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
 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
 def postOptions(self):
     if self['https']:
         try:
             from twisted.internet.ssl import DefaultOpenSSLContextFactory
         except ImportError:
             raise usage.UsageError("SSL support not installed")
示例#24
0
 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
 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
 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)")