populate database with defaults

Populate the created database with the default values for ‘modifiers’, ‘actions’, ‘games’, ‘game_keys’, ‘categories’ and ‘bindings’.

source

populate_categories

 populate_categories (db)

Populate the categories table with initial data


source

populate_modifiers

 populate_modifiers (db)

Populate the modifiers table with initial data


source

populate_game_keys

 populate_game_keys (db)

Populate the game_keys table with initial data


source

populate_actions

 populate_actions (db)

Populate the actions table with initial data


source

create_default_game

 create_default_game (db)

Create the default game template with standard bindings


source

setup_fresh_db

 setup_fresh_db ()

Create a fresh database with all initial data

Start with a fresh database

WARNING: This will erase all data in the database!

Use an existing database on disk

db = init_db()
db.t.categories()
[{'id': 1, 'name': 'movement', 'description': 'Movement related actions'},
 {'id': 2, 'name': 'combat', 'description': 'Combat related actions'},
 {'id': 3, 'name': 'interaction', 'description': 'Manipulate the environment'},
 {'id': 4,
  'name': 'communication',
  'description': 'Communicate with friends and bots'},
 {'id': 5, 'name': 'menu', 'description': 'Access the menus'}]
db.t.bindings()
[{'id': 1,
  'game_id': 1,
  'action_id': 1,
  'key_id': 23,
  'modifier_id': 2,
  'description': None,
  'sort_order': 101},
 {'id': 2,
  'game_id': 1,
  'action_id': 2,
  'key_id': 19,
  'modifier_id': 2,
  'description': None,
  'sort_order': 102},
 {'id': 3,
  'game_id': 1,
  'action_id': 3,
  'key_id': 1,
  'modifier_id': 2,
  'description': None,
  'sort_order': 103},
 {'id': 4,
  'game_id': 1,
  'action_id': 4,
  'key_id': 4,
  'modifier_id': 2,
  'description': None,
  'sort_order': 104},
 {'id': 5,
  'game_id': 1,
  'action_id': 5,
  'key_id': 52,
  'modifier_id': 1,
  'description': None,
  'sort_order': 105},
 {'id': 6,
  'game_id': 1,
  'action_id': 6,
  'key_id': 3,
  'modifier_id': 1,
  'description': None,
  'sort_order': 106},
 {'id': 7,
  'game_id': 1,
  'action_id': 7,
  'key_id': 51,
  'modifier_id': 1,
  'description': None,
  'sort_order': 107},
 {'id': 8,
  'game_id': 1,
  'action_id': 8,
  'key_id': 55,
  'modifier_id': 2,
  'description': None,
  'sort_order': 108},
 {'id': 9,
  'game_id': 1,
  'action_id': 9,
  'key_id': 49,
  'modifier_id': 2,
  'description': None,
  'sort_order': 109},
 {'id': 10,
  'game_id': 1,
  'action_id': 10,
  'key_id': 65,
  'modifier_id': 2,
  'description': None,
  'sort_order': 110},
 {'id': 11,
  'game_id': 1,
  'action_id': 11,
  'key_id': 66,
  'modifier_id': 2,
  'description': None,
  'sort_order': 111},
 {'id': 12,
  'game_id': 1,
  'action_id': 12,
  'key_id': 63,
  'modifier_id': 1,
  'description': None,
  'sort_order': 201},
 {'id': 13,
  'game_id': 1,
  'action_id': 13,
  'key_id': 64,
  'modifier_id': 1,
  'description': None,
  'sort_order': 202},
 {'id': 14,
  'game_id': 1,
  'action_id': 14,
  'key_id': 18,
  'modifier_id': 1,
  'description': None,
  'sort_order': 203},
 {'id': 15,
  'game_id': 1,
  'action_id': 15,
  'key_id': 67,
  'modifier_id': 3,
  'description': None,
  'sort_order': 204},
 {'id': 16,
  'game_id': 1,
  'action_id': 16,
  'key_id': 8,
  'modifier_id': 1,
  'description': None,
  'sort_order': 205},
 {'id': 17,
  'game_id': 1,
  'action_id': 17,
  'key_id': 7,
  'modifier_id': 1,
  'description': None,
  'sort_order': 206},
 {'id': 18,
  'game_id': 1,
  'action_id': 18,
  'key_id': 17,
  'modifier_id': 1,
  'description': None,
  'sort_order': 207},
 {'id': 19,
  'game_id': 1,
  'action_id': 19,
  'key_id': 6,
  'modifier_id': 1,
  'description': None,
  'sort_order': 208},
 {'id': 20,
  'game_id': 1,
  'action_id': 20,
  'key_id': 5,
  'modifier_id': 1,
  'description': None,
  'sort_order': 301},
 {'id': 21,
  'game_id': 1,
  'action_id': 21,
  'key_id': 20,
  'modifier_id': 1,
  'description': None,
  'sort_order': 401},
 {'id': 22,
  'game_id': 1,
  'action_id': 22,
  'key_id': 50,
  'modifier_id': 1,
  'description': None,
  'sort_order': 402},
 {'id': 23,
  'game_id': 1,
  'action_id': 23,
  'key_id': 26,
  'modifier_id': 1,
  'description': None,
  'sort_order': 403},
 {'id': 24,
  'game_id': 1,
  'action_id': 24,
  'key_id': 2,
  'modifier_id': 1,
  'description': None,
  'sort_order': 404},
 {'id': 25,
  'game_id': 1,
  'action_id': 25,
  'key_id': 56,
  'modifier_id': 1,
  'description': None,
  'sort_order': 501},
 {'id': 26,
  'game_id': 1,
  'action_id': 26,
  'key_id': 13,
  'modifier_id': 1,
  'description': None,
  'sort_order': 502},
 {'id': 27,
  'game_id': 1,
  'action_id': 27,
  'key_id': 53,
  'modifier_id': 1,
  'description': None,
  'sort_order': 503}]
game_id=1
db.t.bindings.rows_where("game_id = ?", game_id)
<generator object Queryable.rows_where>
db.t
actions, bindings, categories, game_keys, games, modifiers, sqlite_stat1, sqlite_stat4
db.conn.close()