From e41f3268cac2b434eeffe0fb2c1ea3b4e3354979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 17 Jan 2017 16:09:43 +0100 Subject: [PATCH] Support calling BAM pack via 'python -m bam.pack'. This allows us to run "setup.py bdist_wheel", put the wheel on the PYTHONPATH, and run BAM pack without having to install it on a virtualenv. The main purpose is to be able to ship this wheel with Blender. Updating Blender's version of BAM thus requires only putting in a new wheel file, rather than the old error-prone approach of copy-and-edit. --- bam/__main__.py | 8 ++++++++ bam/pack.py | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 bam/__main__.py create mode 100644 bam/pack.py diff --git a/bam/__main__.py b/bam/__main__.py new file mode 100644 index 0000000..c5f166b --- /dev/null +++ b/bam/__main__.py @@ -0,0 +1,8 @@ +"""Main module for running python -m bam. + +Doesn't do much, except for printing general usage information. +""" + +print("The 'bam' module cannot be run directly. The following subcommand is available:") +print() +print("python -m bam.pack") diff --git a/bam/pack.py b/bam/pack.py new file mode 100644 index 0000000..8df5b9d --- /dev/null +++ b/bam/pack.py @@ -0,0 +1,10 @@ +"""CLI interface to BAM-pack. + +Run this using: + +python -m bam.pack +""" + +if __name__ == '__main__': + from bam.blend import blendfile_pack + blendfile_pack.main()