/src/langs/__init__.py

http://pyaimt.googlecode.com/ · Python · 14 lines · 10 code · 2 blank · 2 comment · 5 complexity · 79ae2afc299151fd12af792aaa0f4935 MD5 · raw file

  1. # Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com>
  2. # Licensed for distribution under the GPL version 2, check COPYING for details
  3. import os
  4. files=os.listdir("src/langs")
  5. for i in range(len(files)):
  6. if files[i] == "__init__.py": continue
  7. if files[i].endswith(".py"):
  8. files[i] = files[i].replace(".py","")
  9. try:
  10. exec("from %s import *" % files[i])
  11. except UnicodeDecodeError:
  12. print "Unable to import language %s.\n" % files[i]