include_file Module

Defines utilities for parsing include files:
  • get_include_filename(card_lines, include_dir=’’, is_windows=None)

pyNastran.bdf.bdf_interface.include_file.get_include_filename(log: SimpleLogger, include_lines: list[str], include_dirs: list[str], replace_includes: dict[str, str], source_filename: str = '', is_windows: bool | None = None, debug: bool = False, write_env_on_error: bool = False) str[source]

Parses an INCLUDE file split into multiple lines (as a list).

Parameters:
include_lineslist[str]

the list of lines in the include card (all the lines!)

include_dirslist[str]

the include directory

is_windows: Optional[bool]

None: set it dynamically bool:

Windows/Linux/Mac have different enviornment variable forms (%PATH% for Windows and $PATH for Linux/Mac). There are also different characters that are allowed in paths.

Returns:
filenamestr

the INCLUDE filename

pyNastran.bdf.bdf_interface.include_file.parse_include_lines(card_lines: list[str]) str[source]

handles splitting out the INCLUDE lines

pyNastran.bdf.bdf_interface.include_file.split_drive_token(itoken: int, tokens: tuple[str, ...], is_windows: bool, debug: bool = False) tuple[tuple[str, ...], list[str]][source]
splits the drive off:

C:/work/file.bdf (Windows) ENVVAR:file.bdf (Windows/Linux)

pyNastran.bdf.bdf_interface.include_file.split_filename_into_tokens(include_dir: str, filename: str, is_windows: bool, debug: bool = False) Path[source]

Tokens are the individual components of paths

Invalid Linux Tokens ‘0’ (NUL)

Invalid Windows Tokens < (less than) > (greater than) : (colon - sometimes works, but is actually NTFS Alternate Data Streams) “ (double quote) / (forward slash) (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk) All control codes (<= 31)

pyNastran.bdf.bdf_interface.include_file.split_tokens(tokens: tuple[str], is_windows: bool, debug: bool = False) list[str][source]

converts a series of path tokens into a joinable path