Optimizations:
[python-bulletml.git] / setup.py
1 #!/usr/bin/env python
2
3 import glob
4 import os
5 import shutil
6
7 from distutils.core import setup
8 from distutils.command.clean import clean as distutils_clean
9
10 class clean(distutils_clean):
11 def run(self):
12 # In addition to what the normal clean run does, remove pyc
13 # and pyo and backup files from the source tree.
14 distutils_clean.run(self)
15 def should_remove(filename):
16 if (filename.lower()[-4:] in [".pyc", ".pyo"] or
17 filename.endswith("~") or
18 (filename.startswith("#") and filename.endswith("#"))):
19 return True
20 else:
21 return False
22 for pathname, dirs, files in os.walk(os.path.dirname(__file__)):
23 for filename in filter(should_remove, files):
24 try: os.unlink(os.path.join(pathname, filename))
25 except EnvironmentError, err:
26 print str(err)
27
28 try: os.unlink("MANIFEST")
29 except OSError: pass
30
31 for base in ["coverage", "build", "dist"]:
32 path = os.path.join(os.path.dirname(__file__), base)
33 if os.path.isdir(path):
34 shutil.rmtree(path)
35
36 if __name__ == "__main__":
37 from bulletml import VERSION_STRING
38 setup(cmdclass=dict(clean=clean),
39 name="python-bulletml", version=VERSION_STRING,
40 url="http://code.google.com/p/python-bulletml/",
41 description="parse and run BulletML scripts",
42 author="Joe Wreschnig",
43 author_email="joe.wreschnig@gmail.com",
44 license="MIT-style",
45 packages=["bulletml"],
46 data_files=glob.glob("examples/*/*.xml") + ["examples/template.xml"],
47 scripts=["bulletml-runner"],
48 long_description="""\
49 BulletML is the Bullet Markup Language. BulletML can describe the
50 barrage of bullets in shooting games. (For example Progear, Psyvariar,
51 Gigawing2, G DARIUS, XEVIOUS, ...) This module parses and executes
52 BulletML scripts in Python. All data structures in it are
53 renderer-agnostic. A sample renderer for Pygame is included.
54
55 More information is available at the BulletML homepage,
56 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html, or the
57 python-bullet homepage, http://code.google.com/p/python-bulletml/.
58 """
59 )