AppStreamGlib.Review

g AppStreamGlib.Review AppStreamGlib.Review GObject.Object GObject.Object GObject.Object->AppStreamGlib.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

AppStreamGlib.Review

r/w/c

description

str

r/w/c

flags

int

r/w/c

id

str

r/w/c

locale

str

r/w/c

rating

int

r/w/c

reviewer-id

str

r/w/c

reviewer-name

str

r/w/c

summary

str

r/w/c

version

str

r/w/c

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class AppStreamGlib.Review(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStreamGlib.ReviewClass

classmethod new()[source]
Returns:

a AppStreamGlib.Review

Return type:

AppStreamGlib.Review

Creates a new AppStreamGlib.Review.

New in version 0.6.1.

add_flags(flags)[source]
Parameters:

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

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

New in version 0.6.1.

add_metadata(key, value)[source]
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.6.1.

equal(review2)[source]
Parameters:

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

Returns:

True for success

Return type:

bool

Checks if two reviews are the same.

New in version 0.6.1.

get_date()[source]
Returns:

the GLib.DateTime, or None for unset

Return type:

GLib.DateTime

Gets the date the review was originally submitted.

New in version 0.6.1.

get_description()[source]
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.6.1.

get_flags()[source]
Returns:

a AppStreamGlib.ReviewFlags, e.g. AppStreamGlib.ReviewFlags.SELF

Return type:

AppStreamGlib.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.6.1.

get_id()[source]
Returns:

the review identifier, e.g. “deadbeef”

Return type:

str

Gets the review id.

New in version 0.6.1.

get_locale()[source]
Returns:

the string, or None

Return type:

str

Gets the locale for the review.

New in version 0.6.1.

get_metadata_item(key)[source]
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.6.1.

get_priority()[source]
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.6.1.

get_rating()[source]
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.6.1.

get_reviewer_id()[source]
Returns:

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

Return type:

str

Gets the name of the reviewer.

New in version 0.6.1.

get_reviewer_name()[source]
Returns:

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

Return type:

str

Gets the name of the reviewer.

New in version 0.6.1.

get_summary()[source]
Returns:

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

Return type:

str

Gets the review summary.

New in version 0.6.1.

get_version()[source]
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.6.1.

set_date(date)[source]
Parameters:

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

Sets the date the review was originally submitted.

New in version 0.6.1.

set_description(description)[source]
Parameters:

description (str) – multi-line description

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

New in version 0.6.1.

set_flags(flags)[source]
Parameters:

flags (AppStreamGlib.ReviewFlags) – a AppStreamGlib.ReviewFlags, e.g. AppStreamGlib.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.6.1.

set_id(id)[source]
Parameters:

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

Sets the review identifier that is unique to each review.

New in version 0.6.1.

set_locale(locale)[source]
Parameters:

locale (str) – locale, e.g. “en_GB”

Sets the locale for the review.

New in version 0.6.1.

set_priority(priority)[source]
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.6.1.

set_rating(rating)[source]
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.6.1.

set_reviewer_id(reviewer_id)[source]
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.6.1.

set_reviewer_name(reviewer_name)[source]
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.6.1.

set_summary(summary)[source]
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.6.1.

set_version(version)[source]
Parameters:

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

Sets the version string for the application being reviewed.

New in version 0.6.1.

Property Details

AppStreamGlib.Review.props.date
Name:

date

Type:

AppStreamGlib.Review

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.description
Name:

description

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.locale
Name:

locale

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.rating
Name:

rating

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.reviewer_id
Name:

reviewer-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.reviewer_name
Name:

reviewer-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.summary
Name:

summary

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.

AppStreamGlib.Review.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

New in version 0.6.1.