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: object

Is 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

isfloat()[source]

Determines if it can be a double

isint()[source]

Determines if it can be an integer

ismask()[source]

Determines if we can be an Amber mask or not

lower()[source]

Make the argument lower-case

mark()[source]

Provide a way of forcibly marking an argument

unmark()[source]

Provide a way of forcibly unmarking an argument

class parmed.tools.argumentlist.ArgumentList(inp)[source]

Bases: object

List 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_key_float(key, default)[source]

Get a float that follows a keyword

get_key_int(key, default)[source]

Get an integer that follows a keyword

get_key_mask(key, default)[source]

Get a mask that follows a keyword

get_key_string(key, default)[source]

Get a string that follows a keyword

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

has_key(key, mark=True)[source]

See if a particular keyword is present (optionally mark it)

tokenize(instring)[source]

Tokenizes the line, everything between quotes is a single token, including whitespace

unmarked()[source]

Returns all unmarked arguments as a list of strings