#!/usr/bin/python
"""
/***************************************************************************

	Author 			:Charles B. Cosse 
	
	Email			:ccosse@asymptopia.org
	
	Website			:http://www.asymptopia.org
	
	Copyright		:(C) 2002-2004 Asymptopia Software.
	
 ***************************************************************************/
"""
import sys
from asymptopia.tuxmathscrabble import *

DEBUG=0
if __name__=='__main__':
		try:
			for sitepkgdir in sys.path:
				if sitepkgdir[-13:]=='site-packages':break
		except:pass
		tmsdir=os.path.join(sitepkgdir,'asymptopia')
		themedir=os.path.join(tmsdir,'themes')
		themes=[]
		for d in os.listdir(themedir):
			if DEBUG:print d
			if os.path.isdir(os.path.join(themedir,d)):
				themes.append(d)
		if DEBUG:print 'available themes: ',themes
		
		LEVEL=1
		theme_name=None
		try:
			theme_name=themes[0]
			if DEBUG:print 'using themes[0]=',theme_name
		except:theme_name='default'
		while LEVEL>0:
			t=TuxMathScrabble(themes,theme_name,LEVEL)
			#t.startup()
			theme_name,LEVEL=t.play()
			#break
	

