48 lines
796 B
Python
48 lines
796 B
Python
# Bryan Schumaker (8/7/2010)
|
|
|
|
__all__ = [ "collection", "music",
|
|
"data", "event", "map", "path", "plugin"]
|
|
|
|
import event
|
|
import path
|
|
from map import Map
|
|
|
|
# Variables are not saved across sessions, but preferences are
|
|
vars = None
|
|
prefs = None
|
|
|
|
plugin = None
|
|
music = None
|
|
|
|
|
|
# Initialize helpful variables
|
|
def init():
|
|
global vars
|
|
global prefs
|
|
vars = Map()
|
|
prefs = Map("preferences")
|
|
event.start("POSTINIT")
|
|
|
|
|
|
# If a preference has not already been set, set pref[key] = value
|
|
def init_pref(key, value):
|
|
global prefs
|
|
if prefs.get(key) == None:
|
|
prefs[key] = value
|
|
|
|
|
|
def startup():
|
|
global music
|
|
global plugin
|
|
import music
|
|
import plugin
|
|
event.start("PRESTART")
|
|
music.init()
|
|
plugin.load_all()
|
|
event.start("POSTSTART")
|
|
|
|
|
|
def shutdown():
|
|
event.start("PREQUIT")
|
|
event.start("POSTQUIT")
|