Action: Fix probable bug in direction handling when there's only one frame left.
[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-parse", "bulletml-runner"],
48 long_description="""\
49 This module parses and runs BulletML scripts. BulletML is a markup
50 language for describing complex bullet patterns in shooting games.
51 More information is available at the BulletML homepage,
52 http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html.
53
54 The module code is renderer-agnostic. A sample renderer for Pygame is
55 included.
56 """
57 )