parmed.tools.argumentlist module¶
This stores a list of arguments, tokenizing a string into a list of arguments.
-
class
parmed.tools.argumentlist.Argument(string)[source]¶ Bases:
objectIs an argument
Methods
isfloat()Determines if it can be a double
isint()Determines if it can be an integer
ismask()Determines if we can be an Amber mask or not
lower()Make the argument lower-case
mark()Provide a way of forcibly marking an argument
unmark()Provide a way of forcibly unmarking an argument
-
class
parmed.tools.argumentlist.ArgumentList(inp)[source]¶ Bases:
objectList of arguments. The arguments should be parsed in the following order to ensure it’s done correctly:
get_key_* get_next_int get_next_float get_next_mask get_next_string
Methods
get_key_float(key, default)Get a float that follows a keyword
get_key_int(key, default)Get an integer that follows a keyword
get_key_mask(key, default)Get a mask that follows a keyword
get_key_string(key, default)Get a string that follows a keyword
get_next_float([optional, default])Returns the next unmarked float in the token list
get_next_int([optional, default])Returns the next unmarked integer in the token list
get_next_mask([optional, default])Returns the next string as long as it matches a mask
get_next_string([optional, keep_quotes, default])Returns the next unmarked float in the token list
has_key(key[, mark])See if a particular keyword is present (optionally mark it)
tokenize(instring)Tokenizes the line, everything between quotes is a single token, including whitespace
unmarked()Returns all unmarked arguments as a list of strings
-
get_next_float(optional=False, default=None)[source]¶ Returns the next unmarked float in the token list
-
get_next_int(optional=False, default=None)[source]¶ Returns the next unmarked integer in the token list
-
get_next_mask(optional=False, default=None)[source]¶ Returns the next string as long as it matches a mask
-
get_next_string(optional=False, keep_quotes=False, default=None)[source]¶ Returns the next unmarked float in the token list
-