AppStream.ContentRating¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class AppStream.ContentRating(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod attribute_from_csm_age(id, age)¶
- Parameters:
- Returns:
the
AppStream.ContentRatingValue
, orAppStream.ContentRatingValue.UNKNOWN
if unknown- Return type:
Gets the highest
AppStream.ContentRatingValue
which is allowed to be seen by the given Common Sense Media age for the given subsection id.For example, if the CSM age mappings for
violence-bloodshed
are:age ≥ 0 for
AppStream.ContentRatingValue.NONE
age ≥ 9 for
AppStream.ContentRatingValue.MILD
age ≥ 11 for
AppStream.ContentRatingValue.MODERATE
age ≥ 18 for
AppStream.ContentRatingValue.INTENSE
then calling this function withviolence-bloodshed
and age set to 17 would returnAppStream.ContentRatingValue.MODERATE
. Calling it with age 18 would returnAppStream.ContentRatingValue.INTENSE
.
New in version 0.12.12.
- classmethod attribute_get_description(id, value)¶
- Parameters:
id (
str
) – the subsection ID e.g.violence-cartoon
value (
AppStream.ContentRatingValue
) – theAppStream.ContentRatingValue
, e.g.AppStream.ContentRatingValue.INTENSE
- Returns:
a human-readable description of id and value
- Return type:
Get a human-readable description of what content would be expected to require the content rating attribute given by id and value.
New in version 0.12.12.
- classmethod attribute_to_csm_age(id, value)¶
- Parameters:
id (
str
) – the subsection ID e.g.violence-cartoon
value (
AppStream.ContentRatingValue
) – theAppStream.ContentRatingValue
, e.g.AppStream.ContentRatingValue.INTENSE
- Returns:
The age in years, or 0 for no details.
- Return type:
Gets the Common Sense Media approved age for a specific rating level.
New in version 0.12.10.
- classmethod get_all_rating_ids()¶
- Returns:
a
None
-terminated array of IDs, to be freed withGLib.free
() (the element values are owned by libappstream and must not be freed)- Return type:
[
str
]
Returns a list of all the valid OARS content rating attribute IDs as could be passed to
AppStream.ContentRating.add_attribute
() orAppStream.ContentRating.attribute_to_csm_age
().New in version 0.12.10.
- classmethod new()¶
- Returns:
- Return type:
Creates a new
AppStream.ContentRating
.New in version 0.11.0.
- add_attribute(id, value)¶
- Parameters:
id (
str
) – a content rating ID, e.g.money-gambling
.value (
AppStream.ContentRatingValue
) – aAppStream.ContentRatingValue
, e.g.AppStream.ContentRatingValue.MODERATE
.
Adds an attribute value to the content rating.
New in version 0.14.0.
- get_kind()¶
-
Gets the content_rating kind.
New in version 0.11.0.
- get_minimum_age()¶
- Returns:
The age in years, 0 for no rating, or
GObject.G_MAXUINT
for no details.- Return type:
Gets the lowest Common Sense Media approved age for the content_rating block. NOTE: these numbers are based on the data and descriptions available from https://www.commonsensemedia.org/about-us/our-mission/about-our-ratings and you may disagree with them.
You’re free to disagree with these, and of course you should use your own brain to work our if your child is able to cope with the concepts enumerated here. Some 13 year olds may be fine with the concept of mutilation of body parts; others may get nightmares.
New in version 0.11.0.
- get_rating_ids()¶
- Returns:
None
-terminated array of ratings IDs; each ratings ID is owned by theAppStream.ContentRating
and must not be freed, but the container must be freed withGLib.free
()- Return type:
[
str
]
Gets the set of ratings IDs which are present in this self. An example of a ratings ID is
violence-bloodshed
.The IDs are returned in lexicographical order.
New in version 0.12.10.
- get_value(id)¶
- Parameters:
id (
str
) – A ratings ID, e.g.violence-bloodshed
.- Returns:
the
AppStream.ContentRatingValue
, orAppStream.ContentRatingValue.UNKNOWN
- Return type:
Gets the value of a content rating key.
New in version 0.11.0.
- set_kind(kind)¶
- Parameters:
kind (
str
) – the rating kind, e.g. “oars-1.0”
Sets the content rating kind.
New in version 0.11.0.
- set_value(id, value)¶
- Parameters:
id (
str
) – A ratings ID, e.g.violence-bloodshed
.value (
AppStream.ContentRatingValue
) – AAppStream.ContentRatingValue
, e.g.AppStream.ContentRatingValue.INTENSE
Sets the value of a content rating key.
New in version 0.11.0.