Home | History | Annotate | Download | only in python_gflags

Lines Matching refs:argument

69 The exception argument will be a human-readable string.
80 DEFINE_boolean: typically does not take an argument: say --myflag to
484 other_flag_values: If this argument is not None, it should be the
504 """The flag command line argument is illegal."""
516 # of the flag and its argument, if any, allowing handling of unrecognized flags
1193 Program Argument Syntax Conventions, using getopt:
1198 argv: argument list. Can be of any type that may be converted to a list.
1247 # if it takes an argument. Long options are stored in an array of
1248 # strings. Each string ends with an '=' if it takes an argument.
1652 raise IllegalFlagValue('--flagfile with no argument')
1883 def Parse(self, argument):
1885 self.value = self.parser.Parse(argument)
1887 raise IllegalFlagValue("flag --%s=%s: %s" % (self.name, argument, e))
1994 """Metaclass used to cache and share argument parsers among flags."""
1999 """Returns an instance of the argument parser cls.
2036 The Parse() method checks to make sure that the string argument is a
2044 Argument parser classes must be stateless, since instances are cached
2052 def Parse(self, argument):
2053 """Default implementation: always returns its argument unmodified."""
2054 return argument
2216 argument from the DEFINE_* calls that defined those flags).
2279 FlagsError: When given an argument that is a module name (a
2324 def Convert(self, argument):
2325 """Converts the argument to a boolean; raise ValueError on errors."""
2326 if type(argument) == str:
2327 if argument.lower() in ['true', 't', '1']:
2329 elif argument.lower() in ['false', 'f', '0']:
2332 bool_argument = bool(argument)
2333 if argument == bool_argument:
2334 # The argument is a valid boolean (True, False, 0, or 1), and not just
2338 raise ValueError('Non-boolean argument to boolean flag', argument)
2340 def Parse(self, argument):
2341 val = self.Convert(argument)
2370 Such a boolean flag does not take an argument. If a user wants to
2450 def Parse(self, argument):
2451 val = self.Convert(argument)
2462 def Convert(self, argument):
2463 """Default implementation: always returns its argument unmodified."""
2464 return argument
2499 def Convert(self, argument):
2500 """Converts argument to a float; raises ValueError on errors."""
2501 return float(argument)
2555 def Convert(self, argument):
2557 if type(argument) == str:
2559 if len(argument) > 2 and argument[0] == "0" and argument[1] == "x":
2561 return int(argument, base)
2563 return int(argument)
2597 def Parse(self, argument):
2598 if self.enum_values and argument not in self.enum_values:
2601 return argument
2654 def Parse(self, argument):
2655 if isinstance(argument, list):
2656 return argument
2657 elif argument == '':
2660 return [s.strip() for s in argument.split(self._token)]
2738 arguments: a single argument or a list of arguments (typically a
2739 list of default values); a single argument is converted
2756 # have Flag superclass parse argument, overwriting self.value reference