- oelint_parser
- oelint_parser.cls_stash
- Stash
- StashList
- __init__
- AddFile
- FingerPrint
- Append
- Remove
- AddDistroMachineFromLayer
- Finalize
- GetRecipes
- GetLoneAppends
- GetConfFiles
- GetLinksForFile
- Reduce
- GetItemsFor
- ExpandVar
- GetFiles
- GetLayerRoot
- FindLocalOrLayer
- GetScrComponents
- SafeLineSplit
- GuessRecipeName
- GuessBaseRecipeName
- GuessRecipeVersion
- ExpandTerm
- GetValidPackageNames
- GetValidNamedResources
- IsImage
- IsPackageGroup
- Stash
- oelint_parser.rpl_regex
- oelint_parser.inlinerep
- oelint_parser.constants
- oelint_parser.cls_item
- oelint_parser.parser
oelint_parser is a library to parse bitbake files.
class Stash()
The Stash object is the central storage for extracting the bitbake information.
class StashList(UserList)
Extended list of Items.
def __init__(stash: 'Stash', items: Iterable[Item]) -> None
StashList - Extended list of Items.
Arguments:
stash
Stash - Parent stash objectitems
Iterable - Iterable input
def insert(index: int, item: Item) -> None
Insert into list
Arguments:
index
int - index where to insertitem
Item - object to insert
def append(item: Union[Item, Iterable[Item]]) -> None
Append to list
Arguments:
item
Union[Item, Iterable[Item]] - Item or Iterable of Items
def extend(other: 'Stash.StashList') -> None
Extend list
Arguments:
other
Stash.StashList - Other stash other
def remove(item: Union[Item, Iterable[Item]]) -> None
Remove from list
Arguments:
item
Item - Item(s) to remove
def reduce(filename: str = None,
classifier: Union[Iterable[str], str] = None,
attribute: Union[Iterable[str], str] = None,
attributeValue: Union[Iterable[str], str] = None,
nolink: bool = False) -> 'Stash.StashList'
Filters the list.
NOTE: This is a destructive operation. If you want to have a copy returned use
Stash.Reduce(,...) instead.
Arguments:
filename
str, optional - Full path to file. Defaults to None.classifier
Union[Iterable[str], str], optional - (iterable of) class specifier (e.g. Variable). Defaults to None.attribute
Union[Iterable[str], str], optional - (iterable of) class attribute name. Defaults to None.attributeValue
Union[Iterable[str], str], optional - (iterable of) value of the class attribute value. Defaults to None.nolink
bool, optional - Consider linked files. Defaults to False.
Returns:
Stash.StashList
- self
def __init__(quiet: bool = False,
new_style_override_syntax: bool = False,
negative_inline: bool = False) -> None
Stash object
Arguments:
quiet
bool, optional - No progress printing. Defaults to False.new_style_override_syntax
bool, optional - Enforce new override syntax. Defaults to False.negative_inline
bool, optional - Negative branch inline expansion. Defaults to False.
def AddFile(_file: str,
lineOffset: int = 0,
forcedLink: str = None) -> List[Item]
Adds a file to the stash
Arguments:
_file
str - Full path to file
Arguments:
lineOffset
int - Line offset from the file that include this file (default: {0})forcedLink
type - Force link against a file (default: {None})
Returns:
list
- List of {oelint_parser.cls_item.Item}
@property
def FingerPrint() -> str
Get the SHA1 fingerprint of the current Stash
Returns:
str
- hexdigest checksum
def Append(item: Union[Item, Iterable[Item]]) -> None
appends one or mote items to the stash
Arguments:
item
Item - Item(s) to append
def Remove(item: Union[Item, Iterable[Item]]) -> None
removes one or more items from the stash
Arguments:
item
Item - Item(s) to remove
def AddDistroMachineFromLayer(path: str) -> None
adds machine and distro configuration from the layer of the provided file
Arguments:
path
str - Path to file
def Finalize() -> None
finalize the dependencies within the stash
@functools.cache
def GetRecipes() -> None
Get bb files in stash
Returns:
list
- List of bb files in stash
@functools.cache
def GetLoneAppends() -> List[str]
Get bbappend without a matching bb
Returns:
list
- list of bbappend without a matching bb
@functools.cache
def GetConfFiles() -> List[str]
Get configurations files
Returns:
List[str]
- List of configuration files
@functools.cache
def GetLinksForFile(filename: str) -> List[str]
Get file which this file is linked against
Arguments:
filename
str - full path to file
Returns:
list
- list of full paths the file is linked against
def Reduce(in_list: Iterable[Item],
filename: str = None,
classifier: Union[Iterable[str], str] = None,
attribute: Union[Iterable[str], str] = None,
attributeValue: Union[Iterable[str], str] = None,
nolink: bool = False) -> List[Item]
Reduce a list by filtering
Arguments:
in_list
Stash.StashList - Input list.filename
str, optional - Full path to file. Defaults to None.classifier
Union[Iterable[str], str], optional - (iterable of) class specifier (e.g. Variable). Defaults to None.attribute
Union[Iterable[str], str], optional - (iterable of) class attribute name. Defaults to None.attributeValue
Union[Iterable[str], str], optional - (iterable of) value of the class attribute value. Defaults to None.nolink
bool, optional - Consider linked files. Defaults to False.
Returns:
List[Item]
- Returns a list of items fitting the set filters
def GetItemsFor(filename: str = None,
classifier: Union[Iterable[str], str] = None,
attribute: Union[Iterable[str], str] = None,
attributeValue: Union[Iterable[str], str] = None,
nolink: bool = False) -> 'Stash.StashList'
Get items for filename
Arguments:
filename
str, optional - Full path to file. Defaults to None.classifier
Union[Iterable[str], str], optional - (iterable of) class specifier (e.g. Variable). Defaults to None.attribute
Union[Iterable[str], str], optional - (iterable of) class attribute name. Defaults to None.attributeValue
Union[Iterable[str], str], optional - (iterable of) value of the class attribute value. Defaults to None.nolink
bool, optional - Consider linked files. Defaults to False.
Returns:
Stash.StashList
- Returns a list of items fitting the set filters
def ExpandVar(filename: str = None,
attribute: Union[Iterable[str], str] = None,
attributeValue: Union[Iterable[str], str] = None,
nolink: bool = False) -> dict
Expand variable to dictionary
Arguments:
filename
str - Full path to file (default: {None})attribute
str - class attribute name (default: {None})attributeValue
str - value of the class attribute name (default: {None})nolink
bool - Consider linked files (default: {False})
Returns:
{dict}
- expanded variables from call + base set of variables
@functools.cache
def GetFiles(_file: str, pattern: str) -> List[str]
Get files matching SRC_URI entries
Arguments:
_file
str - Full path to filenamepattern
str - glob pattern to apply
Returns:
list
- list of files matching pattern
@functools.cache
def GetLayerRoot(name: str) -> str
Find the path to the layer root of a file
Arguments:
name
str - filename
Returns:
str
- path to layer root or empty string
@functools.cache
def FindLocalOrLayer(name: str, localdir: str) -> str
Find file in local dir or in layer
Arguments:
name
str - filenamelocaldir
str - path to local dir
Returns:
str
- path to found file or None
@functools.cache
def GetScrComponents(string: str) -> dict
Return SRC_URI components
Arguments:
string
str - raw string
Returns:
dict
- scheme: protocol used, src: source URI, options: parsed options
@functools.cache
def SafeLineSplit(string: str) -> List[str]
Split line in a safe manner
Arguments:
string
str - raw input
Returns:
list
- safely split input
@functools.cache
def GuessRecipeName(_file: str) -> str
Get the recipe name from filename
Arguments:
_file
str - filename
Returns:
str
- recipe name
@functools.cache
def GuessBaseRecipeName(_file: str) -> str
Get the base recipe name from filename (aka BPN)
Arguments:
_file
str - filename
Returns:
str
- recipe name
@functools.cache
def GuessRecipeVersion(_file: str) -> str
Get recipe version from filename
Arguments:
_file
str - filename
Returns:
str
- recipe version
def ExpandTerm(_file: str,
value: str,
spare: List[str] = None,
seen: List[str] = None) -> str
Expand a variable (replacing all variables by known content)
Arguments:
_file
str - Full path to filevalue
str - Variable value to expandspare
list[str] - items to keep unexpanded (default: None)seen
list[str] - seen items (default: None)
Returns:
str
- expanded value
@functools.cache
def GetValidPackageNames(_file: str, strippn: bool = False) -> List[str]
Get known valid names for packages
Arguments:
_file
str - Full path to filestrippn
bool - strip the package name (default: False)
Returns:
list
- list of valid package names
@functools.cache
def GetValidNamedResources(_file: str) -> List[str]
Get list of valid SRCREV resource names
Arguments:
_file
str - Full path to file
Returns:
list
- list of valid SRCREV resource names
@functools.cache
def IsImage(_file: str) -> bool
returns if the file is likely an image recipe or not
Arguments:
_file
str - Full path to file
Returns:
bool
- True if _file is an image recipe
@functools.cache
def IsPackageGroup(_file: str) -> bool
returns if the file is likely a packagegroup recipe or not
Arguments:
_file
str - Full path to file
Returns:
bool
- True if _file is a packagegroup recipe
class RegexRpl()
Safe regex replacements
@staticmethod
def search(pattern: str,
string: str,
timeout: int = 5,
default: object = None,
**kwargs) -> Union[Match, None]
replacement for re.search
Arguments:
pattern
str - regex patternstring
str - input stringtimeout
int, optional - Timeout for operation. On timeoutdefault
will be returned. Defaults to 5.default
type, optional - Default to return on timeout. Defaults to None.
Returns:
Match
- Match object or None
@staticmethod
def split(pattern: str,
string: str,
timeout: int = 5,
default: object = None,
**kwargs) -> List[str]
replacement for re.split
Arguments:
pattern
str - regex patternstring
str - input stringtimeout
int, optional - Timeout for operation. On timeoutdefault
will be returned. Defaults to 5.default
type, optional - Default to return on timeout. Defaults to None.
Returns:
list
- list object or None
@staticmethod
def match(pattern: str,
string: str,
timeout: int = 5,
default: object = None,
**kwargs) -> Union[Match, None]
replacement for re.match
Arguments:
pattern
str - regex patternstring
str - input stringtimeout
int, optional - Timeout for operation. On timeoutdefault
will be returned. Defaults to 5.default
type, optional - Default to return on timeout. Defaults to None.
Returns:
Match
- Match object or None
@staticmethod
def sub(pattern: str,
repl: str,
string: str,
timeout: int = 5,
default: str = '',
**kwargs) -> str
replacement for re.sub
Arguments:
pattern
str - regex patternrepl
str - replacement stringstring
str - input stringtimeout
int, optional - Timeout for operation. On timeoutdefault
will be returned. Defaults to 5.default
type, optional - Default to return on timeout. Defaults to ''.
Returns:
str
- string
@staticmethod
def finditer(pattern: str,
string: str,
timeout: int = 5,
default: object = None,
**kwargs) -> Scanner
replacement for re.finditer
Arguments:
pattern
str - regex patternstring
str - input stringtimeout
int, optional - Timeout for operation. On timeoutdefault
will be returned. Defaults to 5.default
type, optional - Default to return on timeout. Defaults to None.
Returns:
Scanner
- Scanner object or None
def bb_utils_filter(_in: str, negative_clause: bool = False) -> str
bb.utils.filter emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def bb_utils_contains(_in: str, negative_clause: bool = False) -> str
bb.utils.contains emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def bb_utils_contains_any(_in: str, negative_clause: bool = False) -> str
bb.utils.contains_any emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_conditional(_in: str, negative_clause: bool = False) -> str
oe.utils.conditional emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_ifelse(_in: str, negative_clause: bool = False) -> str
oe.utils.ifelse emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_any_distro_features(_in: str,
negative_clause: bool = False) -> str
oe.utils.any_distro_features emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_all_distro_features(_in: str,
negative_clause: bool = False) -> str
oe.utils.all_distro_features emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_vartrue(_in: str, negative_clause: bool = False) -> str
oe.utils.vartrue emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_less_or_equal(_in: str, negative_clause: bool = False) -> str
oe.utils.less_or_equal emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_version_less_or_equal(_in: str,
negative_clause: bool = False) -> str
oe.utils.version_less_or_equal emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def oe_utils_both_contain(_in: str, negative_clause: bool = False) -> str
oe.utils.both_contain emulation
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- True argument of the conditional or None if not applicable
def inlinerep(_in: str, negative_clause: bool = False) -> str
Replaces inline code expressions
Arguments:
_in
str - Input stringnegative_clause
bool - return negative branch
Returns:
str
- Expanded string or None, if not applicable
class Constants()
Interface for constants
def GetByPath(path: str) -> Union[Dict, List]
Get constant from path
Arguments:
path
str - / joined path in the constant structure
Returns:
Union[Dict, List]: Item in structure or empty dictionary
def AddConstants(_dict: dict) -> None
Add constants to the existing
Arguments:
dict
dict - constant dictionary to add
def RemoveConstants(_dict: dict) -> None
Remove constants from the existing
Arguments:
dict
dict - constant dictionary to remove
def OverrideConstants(_dict: dict) -> None
Override constants in the existing db
Arguments:
dict
dict] - constant dictionary with override values
@property
def FunctionsKnown() -> List[str]
Return known functions
Returns:
list
- list of known functions
@property
def FunctionsOrder() -> List[str]
Return function order
Returns:
list
- List of functions to order in their designated order
@property
def VariablesMandatory() -> List[str]
Return mandatory variables
Returns:
list
- List of mandatory variables
@property
def VariablesSuggested() -> List[str]
Return suggested variables
Returns:
list
- List of suggested variables
@property
def MirrorsKnown() -> Dict[str, str]
Return known mirrors and their replacements
Returns:
dict
- Dict of known mirrors and their replacements
@property
def VariablesProtected() -> List[str]
Return protected variables
Returns:
list
- List of protected variables
@property
def VariablesProtectedAppend() -> List[str]
Return protected variables in bbappend files
Returns:
list
- List of protected variables in bbappend files
@property
def VariablesOrder() -> List[str]
Variable order
Returns:
list
- List of variables to order in their designated order
@property
def VariablesKnown() -> List[str]
Known variables
Returns:
list
- List of known variables
@property
def DistrosKnown() -> List[str]
Known distros
Returns:
list
- List of known distros
@property
def MachinesKnown() -> List[str]
Known machines
Returns:
list
- List of known machines
@property
def ImagesClasses() -> List[str]
Classes that are used in images
Returns:
list
- Classes that are used in images
@property
def ImagesVariables() -> List[str]
Variables that are used in images
Returns:
list
- Variables that are used in images
@property
def SetsBase() -> Dict[str, str]
Base variable set
Returns:
dict
- dictionary with base variable set
noqa: P103
class Item()
Base class for all Stash items
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path of origin fileline
int - Overall line counterinfileline
int - Line number in filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed input
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def Line() -> int
Overall line count
Returns:
int
- overall line count of item
@property
def Raw() -> str
Raw string (without inline code blocks)
Returns:
str
- raw string of item
@property
def Origin() -> str
origin of item
Returns:
str
- full path of origin file
@property
def InFileLine() -> int
Line count in file
Returns:
int
- [description]
@property
def RealRaw() -> str
Completely unprocessed raw text
Returns:
str
- completely unprocessed raw text
@property
def IsFromClass() -> bool
Item comes from a bbclass
Returns:
bool
- if item was set in a bbclass
@property
def OverrideDelimiter() -> str
Override delimiter
Returns:
str
- Override delimiter
@property
def IsNewStyleOverrideSyntax() -> bool
New style override syntax detected
Returns:
bool
- True if new style has been detected
@staticmethod
def safe_linesplit(string: str) -> List[str]
Safely split an input line to chunks
Arguments:
string
str - raw input string
Returns:
list
- list of chunks of original string
def get_items() -> List[str]
Return single items
Returns:
list
- lines of raw input
def extract_sub(name: str) -> Tuple[List[str], List[str]]
Extract modifiers
Arguments:
name
str - input string
Returns:
tuple
- clean variable name, modifiers, package specific modifiers
def extract_sub_func(name: str) -> Tuple[List[str], List[str]]
Extract modifiers for functions
Arguments:
name
str - input value
Returns:
tuple
- clean function name, modifiers
def IsFromAppend() -> bool
Item originates from a bbappend
Returns:
bool
- True if coming from a bbappend
def GetAttributes() -> dict
Get all public attributes of this class
Returns:
dict
- all public attributes and their values
class Variable(Item)
Items representing variables in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
value: str,
operator: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - Variable namevalue
str - Variable valueoperator
str - Operation performed to the variable
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def VarName() -> str
Variable name
Returns:
str
- name of variable
@property
def SubItem() -> str
Variable modifiers
Returns:
str
- variable modifiers like packages, machines, appends, prepends
@property
def SubItems() -> List[str]
Variable modifiers list
Returns:
list
- variable modifiers list like packages, machines, appends, prepends
@property
def VarValue() -> str
variable value
Returns:
str
- unstripped variable value
@property
def VarOp() -> str
Variable operation
Returns:
str
- operation did on the variable
@property
def VarNameComplete() -> str
Complete variable name included overrides and flags
Returns:
str
- complete variable name
@property
def VarNameCompleteNoModifiers() -> str
Complete variable name included overrides but without modifiers like append, prepend and remove
Returns:
str
- complete variable name
@property
def RawVarName() -> str
Variable name and flags combined
Returns:
str
- raw representation of the variable name
@property
def VarValueStripped() -> str
Stripped variable value
Returns:
str
- stripped version of variable value
def IsAppend() -> bool
Check if operation is an append
Returns:
bool
- True is variable is appended
def AppendOperation() -> List[str]
Get variable modifiers
Returns:
list
- list could contain any combination of 'append', ' += ', 'prepend' and 'remove'
def get_items(override: str = "", versioned: bool = False) -> List[str]
Get items of variable value
Arguments:
override
str - String to take instead of VarValueversioned
bool - items can be versioned (versions will be stripped in this case)
Returns:
list
- clean list of items in variable value
def IsMultiLine() -> bool
Check if variable has a multiline assignment
Returns:
bool
- True if multiline
def GetDistroEntry() -> str
Get distro specific entries in variable
Returns:
str
- distro specific modifier of variable or ""
def GetMachineEntry() -> str
Get machine specific entries in variable
Returns:
str
- machine specific modifier of variable or ""
def GetClassOverride() -> str
Get class specific entries in variable
Returns:
str
- class specific modifier of variable or ""
def IsImmediateModify() -> bool
Variable operation is done immediately
Returns:
bool
- true if it isn't a prepend/append or remove operation
class Comment(Item)
Items representing comments in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed input
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
def get_items() -> List[str]
Get single lines of block
Returns:
list
- single lines of comment block
class Include(Item)
Items that representing include/require statements.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
incname: str,
fileincluded: str,
statement: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputincname
str - raw name of the include filefileincluded
str - path of the file includedstatement
str - either include or require
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def IncName() -> str
Include name
Returns:
str
- name of the file to include/require
@property
def Statement() -> str
statement either include or require
Returns:
str
- include or require
@property
def FileIncluded() -> str
The file included
Returns:
str
- path to file
def get_items() -> Tuple[str, str]
Get items
Returns:
list
- include name, include statement
class Export(Item)
Items representing export statements in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
value: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - variable name of the exportvalue
str - (optional) value of the export
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def Name() -> str
Name of the exported var
Returns:
str
- name of the exported var
@property
def Value() -> str
value of the export
Returns:
str
- optional value of the export
def get_items() -> Tuple[str, str]
Get items
Returns:
list
- include name, include statement
class Function(Item)
Items representing task definitions in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
body: str,
realraw: str,
python: bool = False,
fakeroot: bool = False,
new_style_override_syntax: bool = False) -> None
[summary]
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - Raw function namebody
str - Function body
Arguments:
python
bool - python function according to parser (default: {False})fakeroot
bool - uses fakeroot (default: {False})new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def IsPython() -> bool
Is python function
Returns:
bool
- is a python function
@property
def IsFakeroot() -> bool
Is fakeroot function
Returns:
bool
- is a python function
@property
def FuncName() -> str
Function name
Returns:
str
- name of function
@property
def FuncNameComplete() -> str
Complete function name (including overrides)
Returns:
str
- complete name of function
@property
def SubItem() -> str
Function modifiers
Returns:
str
- function modifiers like packages, machines, appends, prepends
@property
def SubItems() -> List[str]
Function modifiers list
Returns:
list
- function modifiers list like packages, machines, appends, prepends
@property
def FuncBody() -> str
Function body
Returns:
str
- function body text
@property
def FuncBodyStripped() -> str
Stripped function body
Returns:
str
- stripped function body text
@property
def FuncBodyRaw() -> str
Raw function body (including brackets)
Returns:
str
- raw function body text
def GetDistroEntry() -> str
Get distro specific modifiers
Returns:
str
- distro specific modifier or ""
def GetMachineEntry() -> str
Get machine specific modifiers
Returns:
str
- machine specific modifier or ""
def IsAppend() -> bool
Return if function appends another function
Returns:
bool
- True is append or prepend operation
def get_items() -> List[str]
Get items of function body
Returns:
list
- single lines of function body
class PythonBlock(Item)
Items representing python functions in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - Function name
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def FuncName() -> str
Function name
Returns:
str
- name of function
def get_items() -> List[str]
Get lines of function body
Returns:
list
- lines of function body
class FlagAssignment(Item)
Items representing flag assignments in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
ident: str,
value: str,
varop: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - name of task to be modifiedident
str - task flagvalue
str - value of modificationvarop
str - variable operation
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def VarName() -> str
Variable name
Returns:
str
- name of variable
@property
def Flag() -> str
Flag name
Returns:
str
- Flag name
@property
def VarOp() -> str
Modifier operation
Returns:
str
- used modifier in operation
@property
def Value() -> str
Value
Returns:
str
- value set
@property
def ValueStripped() -> str
Value stripped of the quotes
Returns:
str
- value set
def get_items() -> Tuple[str, str, str, str]
Get items
Returns:
list
- variable name, flag, variable operation, modification value
class FunctionExports(Item)
Items representing EXPORT_FUNCTIONS in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - name of function to be exported
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def FuncNames() -> str
Function name
Returns:
str
- names of exported functions
def get_items() -> List[str]
Get items
Returns:
list
- function names
def get_items_unaliased() -> List[str]
Get items with their bbclass scope names
Returns:
list
- function names in the scope of a bbclass (foo becomes classname-foo in this case)
class TaskAdd(Item)
Items representing addtask statements in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
realraw: str,
before: str = "",
after: str = "",
comment: str = "",
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - name of task to be executed
Arguments:
before
str - before statement (default: {""})after
str - after statement (default: {""})comment
str - optional comment (default: {""})new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def FuncName() -> str
Function name
Returns:
str
- name of function
@property
def Before() -> List[str]
Tasks executed before
Returns:
list
- tasks to be executed before
@property
def After() -> List[str]
Tasks executed after
Returns:
list
- tasks to be executed after
@property
def Comment() -> str
Comment
Returns:
str
- comment if any
def get_items() -> List[str]
get items
Returns:
list
- function name, all before statements, all after statements
class TaskDel(Item)
Items representing deltask statements in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
comment: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - name of task to be executedcomment
str - optional comment
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def FuncName() -> str
Function name
Returns:
str
- name of function
@property
def Comment() -> str
Comment
Returns:
str
- comment if any
def get_items() -> List[str]
get items
Returns:
list
- function name
class MissingFile(Item)
Items representing missing files found while parsing.
def __init__(origin: str,
line: int,
infileline: int,
filename: str,
statement: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filefilename
str - filename of the file that can't be foundstatement
str - either include or require
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def Filename() -> str
Filename of the file missing
Returns:
str
- filename that can't be resolved
@property
def Statement() -> str
statement either include or require
Returns:
str
- include or require
class AddPylib(Item)
Items representing addpylib statements in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
path: str,
namespace: str,
realraw: str,
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputpath
str - path to the namespacenamespace
str - namespace name
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def Path() -> str
Path of the library addition
Returns:
str
- path of the library addition
@property
def Namespace() -> str
Namespace of the addition
Returns:
str
- Namespace of the addition
def get_items() -> Tuple[str, str]
Get items
Returns:
list
- library path, library namespace
class Inherit(Item)
Items that representing inherit(_defer) statements.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
statement: str,
classes: str,
realraw: str,
new_style_override_syntax: bool = False,
inherit_file_paths: Set[str] = None) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputclass
str - class code to inheritstatement
str - inherit statement (INHERIT, inherit or inherit_defer)
Arguments:
new_style_override_syntax
bool - Use ':' a override delimiter (default: {False})inherit_file_paths
Set[str] - Paths of the identified inherited classes
@property
def Class() -> str
Class(es) to inherit
Returns:
str
- class(es) to inherit
@property
def Statement() -> str
inherit statement
Returns:
str
- inherit or inherit_defer
@property
def FilePaths() -> Set[str]
File paths to identified bbclasses
As some classes might not be resolvable in the current context the order doesn't necessarily reflect the order of the inherit statements
Returns:
Set[str]
- File paths to identified bbclasses
def get_items() -> List[str]
Get items
Returns:
list
- parsed Class items
class Unset(Item)
Items representing unset statements in bitbake.
def __init__(origin: str,
line: int,
infileline: int,
rawtext: str,
name: str,
realraw: str,
flag: str = "",
new_style_override_syntax: bool = False) -> None
constructor
Arguments:
origin
str - Full path to file of originline
int - Overall line counterinfileline
int - Line counter in the particular filerawtext
str - Raw input string (except inline code blocks)realraw
str - Unprocessed inputname
str - name of variable to be unset
Arguments:
flag
str - Flag to unsetnew_style_override_syntax
bool - Use ':' a override delimiter (default: {False})
@property
def VarName() -> str
Variable name
Returns:
str
- name of the variable
@property
def Flag() -> str
Variable flag
Returns:
str
- name of the variable flag
def get_items() -> List[str]
get items
Returns:
list
- variable name, variable flag
def get_full_scope(_string: str, offset: int, _sstart: int, _send: int) -> str
get full block of an inline statement
Arguments:
_string
str - input stringoffset
int - offset in string_sstart
int - block start index_send
int - block end index
Returns:
str
- full block on inline statement
def prepare_lines_subparser(_iter: Iterable,
lineOffset: int,
num: int,
line: int,
raw_line: str = None,
negative: bool = False) -> List[str]
preprocess raw input
Arguments:
_iter
iterator - line interator objectlineOffset
int - current line indexnum
int - internal line counterline
int - input stringraw_line
string, optional - internal line representation. Defaults to None.negative
bool - Negative branch inline expansion. Defaults to False
Returns:
list
- list of preproccessed chunks
def prepare_lines(_file: str,
lineOffset: int = 0,
negative: bool = False) -> List[str]
break raw file input into preprocessed chunks
Arguments:
_file
string - Full path to filelineOffset
int, optional - line offset counter. Defaults to 0.negative
bool - Negative branch inline expansion. Defaults to False
Returns:
list
- preprocessed list of chunks
def get_items(stash: object,
_file: str,
lineOffset: int = 0,
new_style_override_syntax: bool = False,
negative: bool = False) -> List[Item]
parses file
Arguments:
stash
oelint_parser.cls_stash.Stash - Stash object_file
string - Full path to filelineOffset
int, optional - line offset counter. Defaults to 0.new_style_override_syntax
bool, optional - default to new override syntax (default: False)negative
bool, optional - Negative branch inline expansion (default: False)
Returns:
list
- List of oelint_parser.cls_item.* representations