Skip to content
Snippets Groups Projects
Commit 189790d5 authored by Samuel Burbulla's avatar Samuel Burbulla Committed by Andreas Dedner
Browse files

Add __main__.py to define commands.

parent c00e6b48
Branches
Tags
1 merge request!932Merge of small MRs that make changes to the Python bindings
......@@ -4,6 +4,7 @@ add_subdirectory(typeregistry)
add_python_targets(dune
__init__
__main__
create
packagemetadata
plotting
......
import sys, os
from argparse import Action, ArgumentParser
from .packagemetadata import get_dune_py_dir
def configure():
# force a reconfiguration of dune-py by deleting tagfile
tagfile = os.path.join(get_dune_py_dir(), ".noconfigure")
if os.path.exists(tagfile):
os.remove(tagfile)
if __name__ == '__main__':
parser = ArgumentParser(description='Execute DUNE commands', prog='dune')
parser.add_argument('command', choices=['configure'], help="Command to be executed")
args = parser.parse_args()
if args.command == 'configure':
print('Configure dune-py module')
configure()
......@@ -371,11 +371,7 @@ def metaData(version=None, dependencyCheck=True):
class dunepyinstall(build_py):
def run(self):
build_py.run(self)
# force a reconfiguration of dune-py by deleting tagfile
tagfile = os.path.join(get_dune_py_dir(), ".noconfigure")
if os.path.exists(tagfile):
os.remove(tagfile)
configure()
setupParams['cmdclass'] = {'build_py': dunepyinstall}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment