MCPcopy Create free account
hub / github.com/NetSys/bess / bind_args

Method bind_args

bessctl/cli.py:380–408  ·  view source on GitHub ↗
(self, cmd, line)

Source from the content-addressed store, hash-verified

378 return []
379
380 def bind_args(self, cmd, line):
381 syntax, desc, func = cmd
382 remainder = line
383 args = []
384
385 for i, syntax_token in enumerate(syntax.split()):
386 if remainder.strip() == '':
387 if syntax_token[0] == '[':
388 args.append(None)
389 continue
390
391 raise self.InternalError('Partial match on "%s"? line: "%s"' %
392 (syntax, line))
393
394 attrs = self.get_var_attrs(syntax_token, remainder.split()[0])
395 if attrs:
396 var_type = attrs[0]
397 else:
398 var_type = 'keyword'
399
400 val, remainder = self.bind_var(var_type, remainder)
401
402 if var_type != 'keyword':
403 args.append(val)
404
405 remainder = remainder.lstrip()
406
407 args = self.get_default_args() + args
408 return func, args
409
410 def call_func(self, func, args):
411 func(*args)

Callers 1

process_one_lineMethod · 0.95

Calls 4

get_var_attrsMethod · 0.95
bind_varMethod · 0.95
get_default_argsMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected