ocarina/libsaria/__init__.py

61 lines
1.0 KiB
Python

# Bryan Schumaker (8/7/2010)
__all__ = [ "collection", "music",
"data", "event", "map", "path", "plugin"]
__major__ = 1
__minor__ = 1
__dev__ = True
__vers__ = "Libsaria %s.%s" % (__major__, __minor__)
if __dev__ == True:
__vers__ += "-dev"
import event
import path
from map import Map
from cache import Cache
# Variables are not saved across sessions, but preferences are
# The cache is also saved across sessions
vars = None
prefs = None
cache = Cache()
plugin = None
music = None
# Initialize helpful variables
def init():
global vars
global prefs
global music
vars = Map()
prefs = Map("preferences")
import music
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) == None:
prefs[key] = value
def startup():
global plugin
import plugin
event.start("PRESTART")
music.init()
plugin.load_all()
event.start("POSTSTART")
def shutdown():
event.start("PREQUIT")
event.start("POSTQUIT")