And install time, if it doesn't exist, for install from git.
py2exe.log
VE
ve
+/data/location_decks/*.json
Development notes
-----------------
-Ensure the JSON is generated from the YAML, for people with out pyyaml::
-
- ./tools/gen_json.py
-
Creating a source distribution with::
python setup.py sdist
*.egg-info/*
+data/location_decks/*.json
debhelper (>= 7.0.50~),
dh-python,
python,
- python-setuptools (>= 0.6b3)
+ python-setuptools (>= 0.6b3),
+ python-yaml
Standards-Version: 3.9.5
X-Python-Version: >= 2.6
Homepage: http://www.robolock-ii.org/
"""Setuptools setup.py file for Robolock II."""
from setuptools import setup, find_packages
+from setuptools.command.sdist import sdist
+from setuptools.command.install import install
+
+from tools import gen_json
try:
import py2exe
# This should probably be pulled from constants.py
VERSION_STR = "0.1"
+
+class NajaSdist(sdist):
+ def run(self):
+ gen_json.main()
+ sdist.run(self)
+
+
+class NajaInstall(install):
+ def run(self):
+ gen_json.main(update=False)
+ install.run(self)
+
+
setup(
name="robolock-II",
version=VERSION_STR,
'pygame',
],
+ setup_requires=[
+ 'PyYAML',
+ ],
+
# Files
packages=find_packages(),
scripts=[
'scripts/naja',
],
+ cmdclass={
+ 'sdist': NajaSdist,
+ 'install': NajaInstall,
+ },
+
# py2exe
windows=[{
'script': 'scripts/naja',
import json
import os
-import yaml
-
-def main():
+def main(update=True):
data = os.path.join(os.path.dirname(__file__), '..', 'data')
deck_dir = os.path.join(data, 'location_decks')
yaml_path = os.path.join(deck_dir, yaml_fn)
json_path = os.path.join(deck_dir, json_fn)
+ if not update and os.path.exists(json_path):
+ continue
+
+ import yaml
with open(yaml_path) as yaml_f:
obj = yaml.safe_load(yaml_f)
with open(json_path, 'w') as json_f: