This function will accomplish the specified accomplishment.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
For this function to work, the specified accomplishment needs to exist on the system. For more details of how to create accomplishments and add them to a collection, see https://wiki.ubuntu.com/Accomplishments/Creating
>>> obj.accomplish("ubuntu-community/registered-on-launchpad")
Returns a database of accomplishment information on the system.
IMPORTANT: you should only ever use this function when you need to as it takes some time to process and return the data. It is recommended that you run this once and import the data into your own data structure in your client and then only re-run this function when you need to.
>>> obj.build_viewer_database()
{dbus.String(u'date-completed'): dbus.String(u'2012-07-04 19:18', variant_level=1), dbus.String(u'locked'): dbus.Boolean(False, variant_level=1), dbus.String(u'title'): dbus.String(u'Filed Bug that was Confirmed', variant_level=1), dbus.String(u'collection-human'): dbus.String(u'Ubuntu Community', variant_level=1), dbus.String(u'collection'): dbus.String(u'ubuntu-community', variant_level=1), dbus.String(u'accomplished'): dbus.Boolean(True, variant_level=1), dbus.String(u'iconpath'): dbus.String(u'/home/jono/.cache/accomplishments/trophyimages/ubuntu-community/default.png', variant_level=1), dbus.String(u'id'): dbus.String(u'ubuntu-community/first-bug-confirmed', variant_level=1), dbus.String(u'categories'): dbus.Array([dbus.String(u'QA')], signature=dbus.Signature('s'), variant_level=1)}
Create an extra-information file that resides in the user’s trophy share.
It is common for accomplishments to require additional information to verify their completion. Clients should ask for this information and then use this function to write the information to the correct part of the trophy share. You can read more about how Extra Information works at https://wiki.ubuntu.com/Accomplishments/Creating/Guide/Theory
As an example, if an accomplishment requires launchpad-email and the data for that information is dave@megadeth.com, this will be written to ~/.local/share/accomplishments/trophies/.extrainformation/launchpad-email and the file will contain dave@megadeth.com. Never write to this location directly, just use this function to do this.
>>> obj.create_extra_information_file("launchpad-email", "dave@megadeth.com")
Returns the accomplishments API version for the installed daemon.
This function is useful when you want to ensure that an accomplishment’s API version works with the installed daemon.
Please note: the accomplishment’s API references the API and might not match the version of the daemon. As an example, the accomplishments API might be 0.2, but the daemon might be version 1.2 and still use the 0.2 accomplishments API version.
>>> obj.get_API_version()
0.2
Returns a list of categories that the specified accomplishment is part of.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Categories can be specified in accomplishments as singular (e.g. Ask Ubuntu) or also include sub-categories (e.g. Ask Ubuntu:Asking); this function returns the categories in these formats.
>>> obj.get_acc_categories("ubuntu-community/registered-on-launchpad")
["Launchpad"]
Returns the collection that a given accomplishment is part of.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
This function returns the collection that the accomplishment specified by accomID) is part of.
>>> obj.get_acc_collection("ubuntu-community/registered-on-launchpad")
ubuntu-community
Returns a database of accomplishment information on the system.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
All accomplishments have information about the accomplishment itself, and this function returns all of this data for the specified accomplishment. This is often useful for displaying this information to the user.
>>> obj.build_viewer_database()
{ dbus.String(u'lang'): dbus.String(u'en', variant_level=1), dbus.String(u'needs-signing'): dbus.String(u'true', variant_level=1), dbus.String(u'date-completed'): dbus.String(u'2012-06-12 22:12', variant_level=1), dbus.String(u'set'): dbus.String(u'infrastructure', variant_level=1), dbus.String(u'locked'): dbus.Boolean(False, variant_level=1), dbus.String(u'help'): dbus.String(u'#launchpad on Freenode', variant_level=1), dbus.String(u'links'): dbus.String(u'http://www.launchpad.net', variant_level=1), dbus.String(u'title'): dbus.String(u'Registered on Launchpad', variant_level=1), dbus.String(u'script-path'): dbus.String(u'/home/jono/source/ubuntu-community-accomplishments/scripts/ubuntu-community/infrastructure/registered-on-launchpad.py', variant_level=1), dbus.String(u'base-path'): dbus.String(u'/home/jono/source/ubuntu-community-accomplishments/accomplishments/ubuntu-community', variant_level=1), dbus.String(u'completed'): dbus.Boolean(True, variant_level=1), dbus.String(u'author'): dbus.String(u'Jono Bacon <jono@ubuntu.com>', variant_level=1), dbus.String(u'collection'): dbus.String(u'ubuntu-community', variant_level=1), dbus.String(u'summary'): dbus.String(u'Launchpad is a website in which we do much of our work in Ubuntu. There we build packages, file and fix bugs, perform translations, manage code, and other activities.\nYou will need to register an account with Launchpad to participate in much of the Ubuntu community. Fortunately, registering is simple, safe, and free.', variant_level=1), dbus.String(u'needs-information'): dbus.String(u'launchpad-email', variant_level=1), dbus.String(u'steps'): dbus.String(u'Load a web browser on your computer.\nIn your web browser go to <tt>http://www.launchpad.net</tt>.\nClick the <i>Register</i> link in the corner of the screen to register.', variant_level=1), dbus.String(u'icon'): dbus.String(u'default.png', variant_level=1), dbus.String(u'type'): dbus.String(u'accomplishment', variant_level=1), dbus.String(u'categories'): dbus.Array([dbus.String(u'Launchpad')], signature=dbus.Signature('s'), variant_level=1), dbus.String(u'description'): dbus.String(u'Registered a Launchpad account', variant_level=1) }
Returns a list of accomplishments that the accomplishment you pass depends on.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Accomplishments can depend on other accomplishments before they are completed: if an accomplishment has not had it’s dependency satisfied, it should be shown in clients as locked.
Accomplishments can specify multiple dependencies and this function returns a list of dependencies that the accomplishment you pass to this function depends on. These dependencies are also returns as accomplishment IDs. If no dependencies exist for the specified accomplishment, an empty list is returned.
>>> obj.get_acc_depends("ubuntu-community/ubuntu-member")
["ubuntu-community/registered-on-launchpad"]
Returns whether the specified accomplishment is recognized on the system.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
>>> obj.get_acc_exists("ubuntu-community/registered-on-launchpad")
True
Returns the icon name for the specified accomplishment.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Note: this function only passes the icon name and not the full path to the icon. If you need this you should use get_acc_icon_path().
>>> obj.get_acc_icon("ubuntu-community/registered-on-launchpad")
default.png
Returns the icon name for the specified accomplishment.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
If you don’t need the full path and just need the icon name, use get_acc_icon().
>>> obj.get_acc_icon_path("ubuntu-community/registered-on-launchpad")
/home/jono/.cache/accomplishments/trophyimages/ubuntu-community/default.png
Returns whether the specified accomplishment is accomplished or not.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
>>> obj.get_acc_is_completed("ubuntu-community/registered-on-launchpad")
True
Returns whether the specified accomplishment is unlocked or not (whether it’s dependencies have been satisfied or not).
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Accomplishments can depend on other accomplishments before they are completed: if an accomplishment has not had it’s dependency satisfied, it should be shown in clients as locked. This function checks whether such dependencies have been completed or not.
>>> obj.get_acc_is_unlocked("ubuntu-community/registered-on-launchpad")
True
Returns whether the specified accomplishment needs to be signed (verified) or not.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Global accomplishments, that is...accomplishments that are within the context of community, typically need to be verified to ensure people don’t fake them. I know, who would think that people would fake these kinds of things. ;-)
Accomplishments that need verifying specify this requirement, and this function returns whether the specified accomplishments needs signing (verifying) or not.
>>> obj.get_acc_categories("ubuntu-community/registered-on-launchpad")
True
Returns the corrosponsing script for the accomplishment.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
Many accomplishments have corrosponding scripts (although not all do), and this function returns a full path to the script.
>>> obj.get_acc_script_path("ubuntu-community/registered-on-launchpad")
/usr/share/accomplishments/scripts/ubuntu-community/infrastructure/registered-on-launchpad.py
Returns the title name of the specified accomplishment.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
>>> obj.get_acc_exists("ubuntu-community/registered-on-launchpad")
'Registered on Launchpad'
Returns all the extra-information data available for the user.
For more information on how extra-information works, see https://wiki.ubuntu.com/Accomplishments/Creating/Guide/Theory
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
The dictionaries returned have a series of fields:
- needs-information - the name of this information field (e.g. launchpad-email).
- value - the user’s data for this field (e.g. bruce@ironmaiden.com for launchpad-email).
- regex - a regular expression that defines the structure of the information.
- description - a summary of the information.
- label - a human readable description of the information.
- collection - the collection this information is used in.
- example - an example of this field set.
>>> obj.get_all_extra_information()
{dbus.String(u'regex'): dbus.String(u'^(https?://)?askubuntu.com/users/\d+/.*', variant_level=1), dbus.String(u'description'): dbus.String(u'The URL of your profile page on Ask Ubuntu', variant_level=1), dbus.String(u'value'): dbus.String(u'http://askubuntu.com/users/42996/jonobacon', variant_level=1), dbus.String(u'label'): dbus.String(u'Ask Ubuntu Profile URL', variant_level=1), dbus.String(u'needs-information'): dbus.String(u'askubuntu-user-url', variant_level=1), dbus.String(u'collection'): dbus.String(u'ubuntu-community', variant_level=1), dbus.String(u'example'): dbus.String(u'http://askubuntu.com/users/NUMBER/USERNAME', variant_level=1)}, signature=dbus.Signature('sv')), dbus.Dictionary({dbus.String(u'regex'): dbus.String(u'', variant_level=1), dbus.String(u'description'): dbus.String(u'The email address used for launchpad.net', variant_level=1), dbus.String(u'value'): dbus.String(u'jono@ubuntu.com', variant_level=1), dbus.String(u'label'): dbus.String(u'Launchpad Email', variant_level=1), dbus.String(u'needs-information'): dbus.String(u'launchpad-email', variant_level=1), dbus.String(u'collection'): dbus.String(u'ubuntu-community', variant_level=1), dbus.String(u'example'): dbus.String(u'', variant_level=1)}
Returns whether the user has chosen to block Ubuntu One sync-daemon bubbles.
Every accomplishment has a unique identifier called an Accomplishment ID that is comprised of the collection and the name of the accomplishment itself (e.g. ubuntu-community collection and registered-in-launchpad accomplishment has an accomplishment ID of ubuntu-community/registered-on-launchpad). You pass this function this Accomplishment ID as it’s parameter.
>>> obj.get_block_ubuntuone_notification_bubbles()
True
Returns a list of authors for a given collection.
Every collection has an identifier (e.g. ubuntu-community) that we use to refer to the group of accomplishments that form that collection.
This function returns all authors (without duplicates) for the collection passed to it. Data is returned in the following format:
Forename Surname <email address>
>>> obj.get_collection_authors("ubuntu-community")
["Tom Araya <tom@slayer.com>", "Nicko McBrain <nicko@ironmaiden.com>", "James Hetfield <james@metallica.com>"]
Returns a list of categories for a given collection.
Every collection has an identifier (e.g. ubuntu-community) that we use to refer to the group of accomplishments that form that collection.
This function returns all categories (without duplicates) for the collection passed to it.
>>> obj.get_collection_categories("ubuntu-community")
["Launchpad", "Ask Ubuntu", "Development", . . .]
Returns whether the collection exists or not on the disk.
Every collection has an identifier (e.g. ubuntu-community) that we use to refer to the group of accomplishments that form that collection.
This function returns a boolean value of whether the collection exists on the current installation.
>>> obj.get_collection_exists("ubuntu-community")
True
Returns the name of the current collection.
Every collection has an identifier (e.g. ubuntu-community) that we use to refer to the group of accomplishments that form that collection.
This function returns the name of the current collection in a human-readable format.
>>> obj.get_collection_authors("ubuntu-community")
'Ubuntu Community'
Returns the required value from the configuration file. For a list of available values see https://wiki.ubuntu.com/Accomplishments/GetInvolved/Hacking#Configuration_Files
Config files are stored in Python ConfigParser format in which you look up the value by section and value.
>>> obj.get_collection_authors("config", "has_u1")
True
Retrieve the data for the current user for the specified extra-information.
It is common for accomplishments to require additional information to verify their completion. Clients should ask for this information and then use this function to write the information to the correct part of the trophy share. You can read more about how Extra Information works at https://wiki.ubuntu.com/Accomplishments/Creating/Guide/Theory
As an example, if an accomplishment requires launchpad-email and the data for that information is dave@megadeth.com, this will be written to ~/.local/share/accomplishments/trophies/.extrainformation/launchpad-email and the file will contain dave@megadeth.com.
This function gets this data for you. It returns a dictionary with the following fields:
- <extra-information-field> - the extra-information field type has the data associated with it (e.g. { ‘launchpad-email’ : 'george@cc.com‘})
- label - the human-readable label for the extra-information field (e.g. ‘Launchpad Email’ for launchpad-email).
collection (str): the collection that the extra-information applies to.
info (str): the name of the extra-information type.
>>> obj.get_extra_information("ubuntu-community", "launchpad-email")
{dbus.String(u'launchpad-email'): dbus.String(u'george@cc.com', variant_level=1), dbus.String(u'label'): dbus.String(u'Launchpad Email', variant_level=1)}
Returns whether the user has opted to publish their accomplishments online.
>>> obj.get_published_status()
True
Returns a list of accomplishment IDs for the all available accomplishments. This includes all accomplishment IDs from all collections.
>>> obj.list_accomplishments()
["ubuntu-community/registered-on-launchpad", "ubuntu-community/ubuntu-member", . . .]
Returns a list of collections available. Collections are listed in their unique formats (e.g. ubuntu-community).
>>> obj.list_collections()
["ubuntu-community", "ubuntu-desktop"]
Returns a list of accomplishment IDs for the all available opportunities. This includes all accomplishment IDs from all sets.
>>> obj.list_opportunitues()
["ubuntu-community/registered-on-launchpad", "ubuntu-community/ubuntu-member", . . .]
Returns a list of trophies for the all available accomplishments in accomplishment ID format.
>>> obj.list_trophies()
["ubuntu-community/registered-on-launchpad", "ubuntu-community/ubuntu-member", . . .]
Returns a list of accomplishment IDs for the all unlocked opportunities. This includes all accomplishment IDs from all collections.
>>> obj.list_unlocked()
["ubuntu-community/registered-on-launchpad", "ubuntu-community/ubuntu-member", . . .]
Returns a list of accomplishment IDs for the all unlocked opportunities that are not completed. This includes all accomplishment IDs from all collections.
>>> obj.list_unlocked()
["ubuntu-community/registered-on-launchpad", "ubuntu-community/ubuntu-member", . . .]