Module Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict If CompareNotIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Call NameLoad Return SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict If CompareNotIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Call NameLoad keyword NameLoad Expr Call AttributeLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str TupleLoad AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str TupleLoad Call NameLoad NameLoad AttributeLoad NameLoad attr Num Return Call NameLoad keyword Num Return Call NameLoad keyword SubscriptLoad SubscriptLoad NameLoad Index Num Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore ListLoad Assign NameStore Call NameLoad GeneratorExp TupleLoad AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad Str attr BinOpMult Str Call NameLoad Call AttributeLoad NameLoad attr BinOpAdd ListLoad Call NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call SubscriptLoad NameLoad Index SubscriptLoad NameLoad Index Num keyword SubscriptLoad NameLoad Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str TupleLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Str TupleLoad Call NameLoad NameLoad decorator_list decorator_list
N/A N/A sqlite3 AchievementBackend N/A object N/A N/A 
    AchievementBackend

    Achievement backends implement the getting/setting/updating of achievements for ``tracked_id``.
    Achievements in the system are tracked for a specific, unique ID, ``tracked_id``.

    AchievementBackend is the most basic implementation of an AchievementBackend, storing all
    tracked information in memory and never persisting it. All of the functions of an
    AchievementBackend work to retrieve an ``Achievement`` instance for a given ``tracked_id``, and
    run the appropriate function on it, storing the results. In the least, storing results for a
    specific achievement, for a specific ``target_id`` should include the ``target_id``, the
    ``Achievement`` class name (``Achievement.__name__``), and the current level
    (``Achievement.current``)

    .. note::
        AchievementBackend is NOT thread safe
     __init__ N/A N/A self N/A N/A N/A N/A self _tracked N/A N/A achievement_for_id N/A N/A self tracked_id achievement N/A N/A N/A  Retrieves the current ``Achievement`` for the given ``tracked_id``. If the given
        ``tracked_id`` does not exist yet, it should be created. Also, if the given ``tracked_id``
        hasn't tracked the given ``Achievement`` yet, a new instance of the ``Achievement`` should
        be created for the given ``tracked_id`` N/A N/A tracked_id N/A self _tracked N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A N/A N/A achievement __name__ N/A N/A self _tracked N/A tracked_id N/A N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A achievement __name__ N/A achievement N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A achievement __name__ N/A achievements_for_id N/A N/A self tracked_id achievements N/A N/A N/A 
        Returns the current achievement for each achievement in ``achievements`` for the given
        tracked_id  N/A r N/A N/A a achievements N/A N/A N/A N/A r append N/A N/A self achievement_for_id tracked_id a N/A r N/A set_level_for_id N/A N/A self tracked_id achievement level N/A N/A N/A  Set the ``level`` for an ``Achievement`` for the given ``tracked_id``  N/A N/A tracked_id N/A self _tracked N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A N/A N/A achievement __name__ N/A N/A self _tracked N/A tracked_id N/A N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A achievement __name__ N/A achievement current level N/A N/A N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A achievement __name__ set_level level N/A get_tracked_ids N/A N/A self N/A N/A N/A N/A N/A N/A self _tracked keys N/A remove_id N/A N/A self tracked_id N/A N/A N/A  Removes *tracked_id* from the backend  N/A N/A tracked_id N/A self _tracked N/A N/A N/A N/A self _tracked N/A tracked_id N/A N/A SQLiteAchievementBackend N/A AchievementBackend N/A N/A 
    Stores achievement data in a SQLite database.

    Arguments:

        dbfile
            The full path and file name to store the SQLite database

    To use, create the backend and then use the :py:func:`set_backend` method of the tracker.

    .. code-block:: python

        mybackend = SQLiteAchievementBackend('/some/db.file')
        tracker.set_backend(mybackend)
     __init__ N/A N/A self dbfile N/A N/A N/A N/A self conn N/A N/A sqlite3 connect dbfile N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute create table if not exists pychievements (tracked_id text, achievement text, level integer) N/A achievement_for_id N/A N/A self tracked_id achievement N/A N/A N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute select level from pychievements where achievement=? and tracked_id=? N/A N/A achievement __name__ N/A str tracked_id N/A rows N/A N/A c fetchall N/A N/A rows N/A N/A N/A N/A c execute insert into pychievements values(?, ?, ?) N/A N/A str tracked_id N/A achievement __name__ 0 N/A N/A achievement current 0 N/A N/A achievement current N/A N/A rows N/A 0 N/A 0 N/A achievements_for_id N/A N/A self tracked_id achievements N/A N/A N/A r N/A N/A achievements N/A dict N/A N/A N/A _ __name__ _ N/A _ achievements N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute N/A select achievement, level from pychievements where tracked_id=? and achievement in (%s) N/A N/A , join N/A ? N/A len N/A N/A achievements keys N/A N/A N/A str tracked_id N/A list N/A N/A achievements keys N/A rows N/A N/A c fetchall N/A N/A i _ N/A enumerate rows N/A N/A N/A N/A r append N/A N/A achievements N/A N/A _ N/A 0 current N/A _ N/A 1 N/A r N/A set_level_for_id N/A N/A self tracked_id achievement level N/A N/A N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute update pychievements set level=? where achievement=? and tracked_id=? N/A level N/A achievement __name__ N/A str tracked_id N/A get_tracked_ids N/A N/A self N/A N/A N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute select distinct tracked_id from pychievements N/A rows N/A N/A c fetchall N/A N/A N/A _ N/A 0 N/A _ rows N/A remove_id N/A N/A self tracked_id N/A N/A N/A N/A self conn N/A N/A c N/A N/A N/A self conn cursor N/A N/A N/A c execute delete from pychievements where tracked_id=? N/A N/A str tracked_id N/A N/A