def playTheme(self):
     base.playMusic(CIGlobals.getThemeSong(), looping=1)
        return

    if base.music is not None:
        base.music.play()


base.accept("PandaPaused", maybeDoSomethingWithMusic, [0])
base.accept("PandaRestarted", maybeDoSomethingWithMusic, [1])
base.accept('MusicEnabled', handleMusicEnabled)


def doneInitLoad():
    notify.info("Initial game load finished.")
    from src.coginvasion.distributed import CogInvasionClientRepository
    base.cr = CogInvasionClientRepository.CogInvasionClientRepository(
        "ver-" + metadata.VERSION)


notify.info("Starting initial game load...")
from InitialLoad import InitialLoad
il = InitialLoad(doneInitLoad)

from src.coginvasion.base import MusicCache
print "Precaching music..."
MusicCache.precacheMusic()

base.playMusic(CIGlobals.getThemeSong(), volume=2.0)
il.load()

base.run()