ford.utils module#
- ford.utils.external(project, make=False, path='.')#
Reads and writes the information needed for processing external modules.
- ford.utils.get_parens(line, retlevel=0, retblevel=0)#
By default akes a string starting with an open parenthesis and returns the portion of the string going to the corresponding close parenthesis. If retlevel != 0 then will return when that level (for parentheses) is reached. Same for retblevel.
- Return type:
- ford.utils.normalise_path(base_dir, path)#
Tidy up path, making it absolute, relative to base_dir
- Return type:
- ford.utils.paren_split(sep, string)#
Splits the string into pieces divided by sep, when sep is outside of parentheses.
- ford.utils.quote_split(sep, string)#
Splits the strings into pieces divided by sep, when sep in not inside quotes.
- ford.utils.register_macro(string)#
Register a new macro definition of the form
key = value
. In the documentation|key|
can then be used to represent value. If key is already defined in the list of macros an RuntimeError will be raised.The function returns a tuple of the form
(value, key)
, where key isNone
if no key definition is found in the string.
- ford.utils.str_to_bool(text)#
Convert string to bool. Only takes ‘true’/’false’, ignoring case
- ford.utils.sub_links(string, project)#
Replace links to different parts of the program, formatted as [[name]] or [[name(object-type)]] with the appropriate URL. Can also link to an item’s entry in another’s page with the syntax [[parent-name:name]]. The object type can be placed in parentheses for either or both of these parts.
- ford.utils.sub_macros(string)#
Replaces macros in documentation with their appropriate values. These macros are used for things like providing URLs.
- ford.utils.sub_notes(docs)#
Substitutes the special controls for notes, warnings, todos, and bugs with the corresponding div.