8 if not os.path.exists(path)
or not os.path.isdir(path):
9 print >> sys.stderr,
"'%s' is not a directory" % path
13 for f
in glob.glob(os.path.join(os.path.basename(path),
'*.py')):
16 modules.append(os.path.splitext(os.path.basename(f))[0])
18 fd = open(os.path.join(path,
'__init__.py'),
'w')
20 fd.write(
'all = [%s' % os.linesep)
22 fd.write(
" '%s',%s" % (m, os.linesep))
23 fd.write(
' ]%s' % os.linesep)
29 if __name__ ==
"__main__":
31 sys.exit(
"usage: %s path/to/gui_modules" % sys.argv[0])
33 sys.exit(
main(sys.argv[1]))