AppStream.Review

g AppStream.Review AppStream.Review GObject.Object GObject.Object GObject.Object->AppStream.Review

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_flags (flags)

add_metadata (key, value)

equal (review2)

get_date ()

get_description ()

get_flags ()

get_id ()

get_locale ()

get_metadata_item (key)

get_priority ()

get_rating ()

get_reviewer_id ()

get_reviewer_name ()

get_summary ()

get_version ()

set_date (date)

set_description (description)

set_flags (flags)

set_id (id)

set_locale (locale)

set_priority (priority)

set_rating (rating)

set_reviewer_id (reviewer_id)

set_reviewer_name (reviewer_name)

set_summary (summary)

set_version (version)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

date

AppStream.Review

r/w/c/en

description

str

r/w/c/en

flags

int

r/w/c/en

id

str

r/w/c/en

locale

str

r/w/c/en

priority

int

r/w/c/en

rating

int

r/w/c/en

reviewer-id

str

r/w/c/en

reviewer-name

str

r/w/c/en

summary

str

r/w/c/en

version

str

r/w/c/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStream.Review(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStream.ReviewClass

classmethod new()
Returns:

a AppStream.Review

Return type:

AppStream.Review

Creates a new AppStream.Review.

New in version 0.14.0.

add_flags(flags)
Parameters:

flags (AppStream.ReviewFlags) – a AppStream.ReviewFlags, e.g. AppStream.ReviewFlags.SELF

Adds flags to an existing review without replacing the other flags.

New in version 0.14.0.

add_metadata(key, value)
Parameters:
  • key (str) – a string

  • value (str) – a string

Adds metadata to the review object. It is left for the the plugin to use this method as required, but a typical use would be to store some secure authentication token.

New in version 0.14.0.

equal(review2)
Parameters:

review2 (AppStream.Review) – a AppStream.Review instance.

Returns:

True for success

Return type:

bool

Checks if two reviews are the same.

New in version 0.14.0.

get_date()
Returns:

the GLib.DateTime, or None for unset

Return type:

GLib.DateTime

Gets the date the review was originally submitted.

New in version 0.14.0.

get_description()
Returns:

the string, or None

Return type:

str

Gets the multi-line review text that forms the body of the review.

New in version 0.14.0.

get_flags()
Returns:

a AppStream.ReviewFlags, e.g. AppStream.ReviewFlags.SELF

Return type:

AppStream.ReviewFlags

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

New in version 0.14.0.

get_id()
Returns:

the review identifier, e.g. “deadbeef”

Return type:

str

Gets the review id.

New in version 0.14.0.

get_locale()
Returns:

the string, or None

Return type:

str

Gets the locale for the review.

New in version 0.14.0.

get_metadata_item(key)
Parameters:

key (str) – a string

Returns:

A string value, or None for not found

Return type:

str

Gets some metadata from a review object. It is left for the the plugin to use this method as required, but a typical use would be to retrieve some secure authentication token.

New in version 0.14.0.

get_priority()
Returns:

the review priority, or 0 for unset.

Return type:

int

This allows the UI to sort reviews into the correct order. Higher numbers indicate a more important or relevant review.

New in version 0.14.0.

get_rating()
Returns:

integer as a percentage, or 0 for unset

Return type:

int

Gets the star rating of the review, where 100 is 5 stars.

New in version 0.14.0.

get_reviewer_id()
Returns:

the reviewer ID, e.g. “deadbeef”, or None

Return type:

str

Gets the name of the reviewer.

New in version 0.14.0.

get_reviewer_name()
Returns:

the reviewer name, e.g. “David Smith”, or None

Return type:

str

Gets the name of the reviewer.

New in version 0.14.0.

get_summary()
Returns:

the one-line summary, e.g. “Awesome application”

Return type:

str

Gets the review summary.

New in version 0.14.0.

get_version()
Returns:

the version string, e.g. “0.1.2”, or None for unset

Return type:

str

Gets the version string for the application being reviewed..

New in version 0.14.0.

set_date(date)
Parameters:

date (GLib.DateTime) – a GLib.DateTime, or None

Sets the date the review was originally submitted.

New in version 0.14.0.

set_description(description)
Parameters:

description (str) – multi-line description

Sets the multi-line review text that forms the body of the review.

New in version 0.14.0.

set_flags(flags)
Parameters:

flags (AppStream.ReviewFlags) – a AppStream.ReviewFlags, e.g. AppStream.ReviewFlags.SELF

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

New in version 0.14.0.

set_id(id)
Parameters:

id (str) – review identifier, e.g. “deadbeef”

Sets the review identifier that is unique to each review.

New in version 0.14.0.

set_locale(locale)
Parameters:

locale (str) – a BCP47 locale, e.g. “en-GB”

Sets the locale for the review.

New in version 0.14.0.

set_priority(priority)
Parameters:

priority (int) – a priority value

Sets the priority for the review, where positive numbers indicate a better review for the specific user.

New in version 0.14.0.

set_rating(rating)
Parameters:

rating (int) – a integer as a percentage, or 0 for unset

Sets the star rating of the review, where 100 is 5 stars..

New in version 0.14.0.

set_reviewer_id(reviewer_id)
Parameters:

reviewer_id (str) – the reviewer ID, e.g. “deadbeef”

Sets the name of the reviewer, which can be left unset.

New in version 0.14.0.

set_reviewer_name(reviewer_name)
Parameters:

reviewer_name (str) – the reviewer name, e.g. “David Smith”

Sets the name of the reviewer, which can be left unset.

New in version 0.14.0.

set_summary(summary)
Parameters:

summary (str) – a one-line summary, e.g. “Awesome application”

Sets the one-line summary that may be displayed in bold.

New in version 0.14.0.

set_version(version)
Parameters:

version (str) – a version string, e.g. “0.1.2”

Sets the version string for the application being reviewed.

New in version 0.14.0.

Property Details

AppStream.Review.props.date
Name:

date

Type:

AppStream.Review

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.locale
Name:

locale

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.priority
Name:

priority

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

The priority for the review, where positive numbers indicate a better review for the specific user.

New in version 0.15.6.

AppStream.Review.props.rating
Name:

rating

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.reviewer_id
Name:

reviewer-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.reviewer_name
Name:

reviewer-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.summary
Name:

summary

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.

AppStream.Review.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

New in version 0.14.0.