resqpy.olio.keyword_filesΒΆ

Basic functions for searching for keywords in an ascii control file such as a nexus deck.

Ascii file must already have been opened for reading before calling any of these functions.

Functions

blank_line

Returns True if the next line contains only white space; False otherwise (including comments).

end_of_file

Returns True if the end of the file has been reached.

find_keyword

Looks for line starting with given keyword; file pointer is left at start of that line.

find_keyword_pair

Looks for line starting with a given pair of keywords.

find_keyword_with_copy

Looks for line starting with given keyword, copying lines in the meantime.

find_keyword_without_passing

Looks for line starting with keyword, but without passing line starting with no_pass_keyword.

find_number

Looks for line starting with any number.

guess_comment_char

Returns a string (usually one character) being the guess as to the comment character, or None.

number_next

Returns True if next token in file is a number.

skip_blank_lines_and_comments

Skips any lines containing only white space or comment.

skip_comments

Skips any lines containing only a comment.

specific_keyword_next

Returns True if next token in file is the specified keyword.

split_trailing_comment

Returns a pair of strings: (line stripped of trailing comment, trailing comment).

strip_trailing_comment

Returns a copy of line with any trailing comment removed.

substring

Returns True if the first argument is a substring of the second.