Malcontent.AppFilterBuilder¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
b0 |
r |
||
b1 |
r |
||
p0 |
r |
||
p1 |
r |
||
p2 |
r |
||
p3 |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Malcontent.AppFilterBuilder¶
Malcontent.AppFilterBuilder
is a stack-allocated mutable structure used to build anMalcontent.AppFilter
instance. UseMalcontent.AppFilterBuilder.init
(), various method calls to set properties of the app filter, and thenMalcontent.AppFilterBuilder.end
(), to construct anMalcontent.AppFilter
.New in version 0.2.0.
- classmethod new()¶
- Returns:
a new heap-allocated
Malcontent.AppFilterBuilder
- Return type:
Construct a new
Malcontent.AppFilterBuilder
on the heap. This is intended for language bindings. The returned builder must eventually be freed withMalcontent.AppFilterBuilder.free
(), but can be cleared zero or more times withMalcontent.AppFilterBuilder.clear
() first.New in version 0.2.0.
- blocklist_content_type(content_type)¶
- Parameters:
content_type (
str
) – a content type to blocklist
Add content_type to the blocklist of content types in the filter under construction. The content_type will not be added again if it’s already been added.
Note that this method doesn’t handle content subtypes. For example, if
application/xml
is added to the blocklist butapplication/xspf+xml
is not, a check for whetherapplication/xspf+xml
is blocklisted would return false.New in version 0.4.0.
- blocklist_flatpak_ref(app_ref)¶
- Parameters:
app_ref (
str
) – a flatpak app ref to blocklist
Add app_ref to the blocklist of flatpak refs in the filter under construction. The app_ref will not be added again if it’s already been added.
New in version 0.2.0.
- blocklist_path(path)¶
- Parameters:
path (
str
) – an absolute path to blocklist
Add path to the blocklist of app paths in the filter under construction. It will be canonicalised (without doing any I/O) before being added. The canonicalised path will not be added again if it’s already been added.
New in version 0.2.0.
- clear()¶
Clear self, freeing any internal state in it. This will not free the top-level storage for self itself, which is assumed to be allocated on the stack.
If called on an already-cleared
Malcontent.AppFilterBuilder
, this function is idempotent.New in version 0.2.0.
- copy()¶
- Returns:
a copy of self
- Return type:
Copy the given self to a newly-allocated
Malcontent.AppFilterBuilder
on the heap. This is safe to use with cleared, stack-allocatedMalcontent.AppFilterBuilders
.New in version 0.2.0.
- end()¶
- Returns:
a newly constructed
Malcontent.AppFilter
- Return type:
Finish constructing an
Malcontent.AppFilter
with the given self, and return it. TheMalcontent.AppFilterBuilder
will be cleared as ifMalcontent.AppFilterBuilder.clear
() had been called.New in version 0.2.0.
- free()¶
Free an
Malcontent.AppFilterBuilder
originally allocated usingMalcontent.AppFilterBuilder.new
(). This must not be called on stack-allocated builders initialised usingMalcontent.AppFilterBuilder.init
().New in version 0.2.0.
- init()¶
Initialise the given self so it can be used to construct a new
Malcontent.AppFilter
. self must have been allocated on the stack, and must not already be initialised.Construct the
Malcontent.AppFilter
by calling methods on self, followed byMalcontent.AppFilterBuilder.end
(). To abort construction, useMalcontent.AppFilterBuilder.clear
().New in version 0.2.0.
- set_allow_system_installation(allow_system_installation)¶
- Parameters:
allow_system_installation (
bool
) –True
to allow app installation;False
to unconditionally disallow it
Set whether the user is allowed to install to the flatpak system repository. If this is
True
, app installation is still subject to the OARS values (Malcontent.AppFilterBuilder.set_oars_value
()). If it isFalse
, app installation is unconditionally disallowed for this user.New in version 0.2.0.
- set_allow_user_installation(allow_user_installation)¶
- Parameters:
allow_user_installation (
bool
) –True
to allow app installation;False
to unconditionally disallow it
Set whether the user is allowed to install to their flatpak user repository. If this is
True
, app installation is still subject to the OARS values (Malcontent.AppFilterBuilder.set_oars_value
()). If it isFalse
, app installation is unconditionally disallowed for this user.New in version 0.2.0.
- set_oars_value(oars_section, value)¶
- Parameters:
oars_section (
str
) – name of the OARS section to set the value forvalue (
Malcontent.AppFilterOarsValue
) – value to set for the oars_section
Set the OARS value for the given oars_section, indicating the intensity of content covered by that section which the user is allowed to see (inclusive). Any apps which have more intense content in this section should not be usable by the user.
New in version 0.2.0.