2010-08-07 12:55:23 -04:00
|
|
|
# Bryan Schumaker (8/7/2010)
|
|
|
|
|
2010-11-14 13:50:35 -05:00
|
|
|
__all__ = [ "audio", "sources",
|
2010-08-15 01:05:37 -04:00
|
|
|
"data", "event", "map", "path", "plugin"]
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2010-10-23 20:17:25 -04:00
|
|
|
__major__ = 1
|
2010-11-05 19:09:26 -04:00
|
|
|
__minor__ = 2
|
2010-10-23 20:17:25 -04:00
|
|
|
__dev__ = True
|
2010-10-24 17:22:24 -04:00
|
|
|
__vers__ = "Libsaria %s.%s" % (__major__, __minor__)
|
2010-11-05 19:09:26 -04:00
|
|
|
if __dev__ == True:
|
2010-10-24 17:22:24 -04:00
|
|
|
__vers__ += "-dev"
|
2010-10-23 20:17:25 -04:00
|
|
|
|
2010-08-07 14:23:50 -04:00
|
|
|
import event
|
2010-08-07 19:39:46 -04:00
|
|
|
import path
|
2010-11-14 17:29:31 -05:00
|
|
|
from trees import Tree, PersPrefTree
|
2010-11-20 09:54:14 -05:00
|
|
|
from path.cache import Cache
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2010-10-24 17:26:53 -04:00
|
|
|
# The cache is also saved across sessions
|
2010-08-07 14:23:50 -04:00
|
|
|
prefs = None
|
2010-10-24 17:26:53 -04:00
|
|
|
cache = Cache()
|
2010-08-07 12:55:23 -04:00
|
|
|
|
2010-08-15 13:39:31 -04:00
|
|
|
plugin = None
|
2010-11-08 20:58:33 -05:00
|
|
|
audio = None
|
2010-10-26 22:44:09 -04:00
|
|
|
lastfm = None
|
2010-08-15 13:39:31 -04:00
|
|
|
|
2010-11-15 21:11:12 -05:00
|
|
|
init_pref = None
|
2010-11-15 08:17:31 -05:00
|
|
|
|
2010-08-07 19:39:46 -04:00
|
|
|
|
2010-08-15 01:05:37 -04:00
|
|
|
# Initialize helpful variables
|
|
|
|
def init():
|
2010-08-07 14:23:50 -04:00
|
|
|
global prefs
|
2010-11-15 21:11:12 -05:00
|
|
|
global init_pref
|
2010-11-08 20:58:33 -05:00
|
|
|
global audio
|
2010-10-26 22:44:09 -04:00
|
|
|
global lastfm
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2010-11-15 21:11:12 -05:00
|
|
|
prefs = trees.get_pref_tree("preferences")
|
|
|
|
init_pref = prefs.init_pref
|
2010-11-08 20:58:33 -05:00
|
|
|
import audio
|
2010-10-26 22:44:09 -04:00
|
|
|
import lastfm
|
2010-10-20 20:04:23 -04:00
|
|
|
|
2010-08-07 19:39:46 -04:00
|
|
|
event.start("POSTINIT")
|
2010-08-13 23:58:19 -04:00
|
|
|
|
|
|
|
|
2010-08-15 01:05:37 -04:00
|
|
|
def startup():
|
2010-08-15 13:39:31 -04:00
|
|
|
global plugin
|
|
|
|
import plugin
|
2010-08-30 17:57:08 -04:00
|
|
|
|
2010-08-19 23:02:30 -04:00
|
|
|
event.start("PRESTART")
|
2010-11-08 20:58:33 -05:00
|
|
|
audio.init()
|
2010-08-15 13:39:31 -04:00
|
|
|
plugin.load_all()
|
2010-08-19 23:02:30 -04:00
|
|
|
event.start("POSTSTART")
|
2010-08-15 13:39:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
def shutdown():
|
|
|
|
event.start("PREQUIT")
|
2010-11-13 21:38:16 -05:00
|
|
|
import plugin
|
|
|
|
plugin.quit()
|
2010-08-15 13:39:31 -04:00
|
|
|
event.start("POSTQUIT")
|
2010-11-14 17:32:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
init()
|