Comps class is representating comps.xml file represented in structure form.
Filter Comps object content by _arch attribute matchingpassed archictures
Parameters: | arch_list (list of strings or libcomps.StrSeq) – list of architectures |
---|---|
Returns: | new libcomps.Comps instace |
Clear Comps
Load COMPS from xml file
Parameters: |
|
---|---|
Returns: | 1 if some non-fatal error occured during parsing 0 if parsing ended without any error |
Raises: |
|
Load COMPS from xml string
Parameters: |
|
---|---|
Returns: | 1 if some non-fatal error occured during parsing 0 if parsing ended without any error |
Raises libcomps.ParserError: | |
if some fatal error occured during parsing |
return list of messages from log of last parse action, contains errors only
return list of messages from log of last parse action.
alias for Comps.xml_f()
alias for Comps.xml_str()
validate inner structure of Comps object.Raise appropriate exception on first occured error
Raises ValueError: | |
---|---|
with appropriate error message |
validate inner structure of Comps class.Returns list of error strings
Return type: | list of strings |
---|
Generate xml output of Comps class to file
Parameters: |
|
---|---|
Returns: | list of errors encountered during xml generating |
Return type: | list of strings |
Raises XMLGenError: | |
if generating xml encounter some fatal error |
Generate xml output of Comps object a return it as string
Parameters: |
|
---|---|
Returns: | string containing xml output |
libcomps.MDict of blacklist
libcomps.CategoryList of categories
libcomps.EnvList of environments
libcomps.GroupList of groups
libcomps.StrDict of langpacks
libcomps.MDict of whiteout
Comps Group list
is class mostly similar to normal python list with few diferences:
g1 = libcomps.Group()
g1.id = "g1"
comps.categories.append(g1)
g2 = libcomps.Group()
g2.id = "g2"
comps.categories.append(g2)
g = comps.groups["g2"]
comps.categories["g1"] = libcomps.Group()
Append item to new of the list
Clear the list
Insert item into list at position pos
Parameters: | pos – intposition |
---|---|
Returns: | None |
Remove first occurence of item from list
Raises: |
|
---|
Comps Category list
is class mostly similar to normal python list with few diferences:
c1 = libcomps.Category()
c1.id = "c1"
comps.categories.append(c1)
c2 = libcomps.Category()
c2.id = "c2"
comps.categories.append(c2)
c = comps.groups["c2"]
comps.categories["c1"] = libcomps.Category()
Append item to new of the list
Clear the list
Insert item into list at position pos
Parameters: | pos – intposition |
---|---|
Returns: | None |
Remove first occurence of item from list
Raises: |
|
---|
Comps Env list
is class mostly similar to normal python list with few diferences:
e1 = libcomps.Environment()
e1.id = "e1"
comps.environments.append(e1)
e2 = libcomps.Environment()
e2.id = "e2"
comps.environments.append(e2)
e = comps.groups["e2"]
comps.categories["e1"] = libcomps.Environment()
Append item to new of the list
Clear the list
Insert item into list at position pos
Parameters: | pos – intposition |
---|---|
Returns: | None |
Remove first occurence of item from list
Raises: |
|
---|
Comps Group
Validate inner group structure. Raise exception on firstoccured error.
Returns: | None if validation successful |
---|---|
Raises ValueError: | |
on first occured error |
Group uservisible attribute
Group default attribute
descrition of group
dictionary of locale group descriptions
Group display order attribute
group string identificator
group langonly attribute
name of group
dictionary of locale group names
Group uservisible attribute
Comps Group Package list
is class mostly similar to normal python list with few diferences:
Comps Group Package
Validate inner package structure. Raise exception on firstoccured error.
Returns: | None if validation successful |
---|---|
Raises ValueError: | |
on first occured error |
Package basearchonly attribute
Package name
Package requires
package type which could be one of following:
Comps Category
validate inner category structure
description of category
dictionary of locale category description
category display order attribute
category string identificator
name of category
dictionary of locale category names
Comps Environment
Validate inner environment structure. Raise exception on firstoccured error.
Returns: | None if validation successful |
---|---|
Raises ValueError: | |
on first occured error |
description of environment
dictionary of locale environment descriptions
environment display order attribute
libcomps.IdList of libcomps.GroupId representing environments group list
environment string identificator
name of environment
dictionary of locale environment names
libcomps.IdList of libcomps.GroupId representing environments option list
Comps GIDs list
is class mostly similar to normal python list with few diferences:
Comps Str Dict
clear the dict
return shallow copy of dict
Return object associated with key
Parameters: | key (str/unicode) – object key |
---|---|
Returns: | object if there’s object associated with key None otherwise |
Tests if there’s key in object
Parameters: | key (str/unicode) – object key |
---|---|
Returns: | True if there’s object associated with key False otherwise |
return list of (key, val) tuples
return iterator returning (key, value) tuple
return iterator returning item’s key
return iterator returning item’s value
return list of keys
Update dictionary with (key,value) pair from another dictionary.Existing pairs are overwritten
Parameters: | dict – libcomps.Dict instance or subclass instance |
---|---|
Returns: | None |
return list of values
is very lightweight version of python dict
- libcomps.StrDict can have only string/unicode keys and accepts only string/unicode object
Comps Dict
clear the dict
return shallow copy of dict
Return object associated with key
Parameters: | key (str/unicode) – object key |
---|---|
Returns: | object if there’s object associated with key None otherwise |
Tests if there’s key in object
Parameters: | key (str/unicode) – object key |
---|---|
Returns: | True if there’s object associated with key False otherwise |
return list of (key, val) tuples
return iterator returning (key, value) tuple
return iterator returning item’s key
return iterator returning item’s value
return list of keys
Update dictionary with (key,value) pair from another dictionary.Existing pairs are overwritten
Parameters: | dict – libcomps.Dict instance or subclass instance |
---|---|
Returns: | None |
return list of values
is class similar to python dict, except of these properties:
- libcomps.MDict can have only string/unicode keys and accepts only list of string or libcomps.StrSeq which is also object returned from dict.__get__()
- output of StrDict.keys() is in alphabetical order ()
Comps Str list
Append item to new of the list
Clear the list
Insert item into list at position pos
Parameters: | pos – intposition |
---|---|
Returns: | None |
Remove first occurence of item from list
Raises: |
|
---|
is class similar to list, but accepts only string/unicode objects.