def message(self, *args, **opts): if len(args) < 2: raise ArgumentError("Invalid number of arguments") return self.make_message(name=args[0], cmd=" ".join(args[1:]), start=opts.get('start', False))
def message(self, *args, **opts): if len(args) > 1: raise ArgumentError("message invalid") if len(args) == 1: return self.make_message(name=args[0]) else: return self.make_message()
def message(self, *args, **opts): if len(args) > 1: raise ArgumentError("Invalid number of arguments") if len(args) == 1: return self.make_message(name=args[0], **opts) return self.make_message(**opts)
def message(self, *args, **opts): if len(args) < 1: raise ArgumentError("Invalid number of arguments") options = {'name': args[0]} if len(args) > 1: options['nb'] = int(args[1]) options.update(opts) return self.make_message(**options)
def validate(self, props): super(Signal, self).validate(props) if 'childpid' in props and 'pid' not in props: raise ArgumentError('cannot specify childpid without pid') try: props['signum'] = to_signum(props['signum']) except ValueError: raise MessageError('signal invalid')
def message(self, *args, **opts): if len(args) < 3: raise ArgumentError("Invalid number of arguments") args = list(args) watcher_name = args.pop(0) if len(args) % 2 != 0: raise ArgumentError("List of key/values is invalid") options = {} while len(args) > 0: kv, args = args[:2], args[2:] kvl = kv[0].lower() options[kvl] = convert_option(kvl, kv[1]) if opts.get('waiting', False): return self.make_message(name=watcher_name, waiting=True, options=options) else: return self.make_message(name=watcher_name, options=options)
def message(self, *args, **opts): if len(args) < 1 or len(args) > 2: raise ArgumentError("Invalid number of arguments") props = {} props['name'] = args[0] if len(args) > 1: props['pid'] = args[1] if opts['signum'] is not None: props['signum'] = opts['signum'] if opts['graceful_timeout'] is not None: props['graceful_timeout'] = opts['graceful_timeout'] return self.make_message(**props)
def message(self, *args, **opts): if len(args) > 2: raise ArgumentError("message invalid") extended = opts.get("extended", False) if len(args) == 2: return self.make_message(name=args[0], process=int(args[1]), extended=extended) elif len(args) == 1: return self.make_message(name=args[0], extended=extended) else: return self.make_message(extended=extended)
def message(self, *args, **opts): largs = len(args) if largs < 2 or largs > 3: raise ArgumentError("Invalid number of arguments") props = { 'name': args[0], 'children': opts.get("children", False), 'recursive': opts.get("recursive", False), 'signum': args[-1], } if len(args) == 3: props['pid'] = int(args[1]) return self.make_message(**props)
def message(self, *args, **opts): if len(args) > 1: raise ArgumentError("invalid number of arguments") graceful = not opts.get("terminate", False) waiting = opts.get("waiting", False) sequential = opts.get("sequential", False) if len(args) == 1: return self.make_message(name=args[0], graceful=graceful, waiting=waiting, sequential=sequential) else: return self.make_message(graceful=graceful, waiting=waiting, sequential=sequential)
def message(self, *args, **opts): if len(args) < 1: raise ArgumentError("number of arguments invalid") return self.make_message(name=args[0])
def message(self, *args, **opts): if len(args) > 0: raise ArgumentError("Invalid number of arguments") return self.make_message()
def message(self, *args, **opts): if len(args) < 2: raise ArgumentError("Invalid number of arguments") return self.make_message(name=args[0], keys=args[1:])