IncludePathKeyword¶
This class is used to manage include directories of the KeyFile. When loading includes, all of the specified directories will be searched for the includes.
-
class
qd.cae.dyna.
IncludePathKeyword
¶ - Attributes
field_size
field_size
position
Notes —– Line index of the
Keyword
.
Methods
align
Type of alignment for comment names and fields:
append_line
(line)- Parameters
get_card_valueByIndex
(iCard, iField[, …])- Parameters
get_card_valueByName
(name[, field_size])- Parameters
- Returns
get_keyword_name
()- Returns
get_line
()- Parameters
get_lines
()- Returns
has_long_fields
()- Returns
insert_line
(iLine, line)- Parameters
- Returns
reformat_all
([skip_cards])- Parameters
reformat_field
(iCard, iField[, field_size, …])- Parameters
remove_line
(iLine)- Parameters
set_card_valueByDict
(fields[, field_size])- Parameters
set_card_valueByIndex
(iCard, iField, value)- Parameters
set_card_valueByName
(name, value[, field_size])- Parameters
set_line
(iLine, line)- Parameters
set_lines
(lines)- Parameters
switch_field_size
([skip_cards])- Parameters
-
get_include_dirs
()¶ - Returns
- include_dirslist of str
list of all include dirs
Notes
The include dirs are from the position of the file, not of the program. For getting the resolved include dirs use
KeyFile.get_include_dirs
.Examples
>>> kf = KeyFile("path/to/keyfile", load_includes=True) >>> # get the first include dir keyword >>> kw = kf["*INCLUDE_PATH"][0] >>> kw.get_include_dirs() ['includes'] >>> # get resolved include dirs (from program location) >>> kf.get_include_dirs() ['path/to/','path/to/includes']
-
is_relative
()¶ - Returns
- is_relativebool
whether the include path defintion describes a relative path
Notes
Same as checking for definition *INCLUDE_PATH_RELATIVE.
Examples
>>> kf = KeyFile("path/to/keyfile", load_includes=True) >>> # get the first include dir keyword >>> kw = kf["*INCLUDE_PATH_RELATIVE"][0] >>> kw.is_relative() True