diff --git a/bfps/Launcher.py b/bfps/Launcher.py index fefa29782e891d4b34a7c39308e73115837ec663..d35cf42b2e93b98c8a468a48a223de9c8891447f 100644 --- a/bfps/Launcher.py +++ b/bfps/Launcher.py @@ -1,8 +1,34 @@ +####################################################################### +# # +# Copyright 2015 Max Planck Institute # +# for Dynamics and Self-Organization # +# # +# This file is part of bfps. # +# # +# bfps is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published # +# by the Free Software Foundation, either version 3 of the License, # +# or (at your option) any later version. # +# # +# bfps is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with bfps. If not, see <http://www.gnu.org/licenses/> # +# # +# Contact: Cristian.Lalescu@ds.mpg.de # +# # +####################################################################### + + + import os import argparse -import .__init__ as bfps +import bfps from .NavierStokes import NavierStokes from .FluidResize import FluidResize from .FluidConvert import FluidConvert @@ -12,7 +38,7 @@ class Launcher: self, base_class = NavierStokes): self.base_class = base_class - self.parser = argparse.ArgumentParser(prog = 'bfps') + self.parser = argparse.ArgumentParser(prog = 'bfps ' + self.base_class.__name__) self.parser.add_argument( '-v', '--version', action = 'version', diff --git a/bfps/__main__.py b/bfps/__main__.py index 747039769f99285c3ad316731759397fe13cb586..75e511f73a900bb487e1e9a35e5a9da9db92ed60 100644 --- a/bfps/__main__.py +++ b/bfps/__main__.py @@ -1,9 +1,53 @@ +####################################################################### +# # +# Copyright 2015 Max Planck Institute # +# for Dynamics and Self-Organization # +# # +# This file is part of bfps. # +# # +# bfps is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published # +# by the Free Software Foundation, either version 3 of the License, # +# or (at your option) any later version. # +# # +# bfps is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with bfps. If not, see <http://www.gnu.org/licenses/> # +# # +# Contact: Cristian.Lalescu@ds.mpg.de # +# # +####################################################################### + + + import sys +import argparse + +import bfps from .Launcher import Launcher +from .NavierStokes import NavierStokes +from .FluidConvert import FluidConvert +from .FluidResize import FluidResize def main(): - l = Launcher() - l(sys.argv[1:]) + parser = argparse.ArgumentParser(prog = 'bfps') + parser.add_argument( + '-v', '--version', + action = 'version', + version = '%(prog)s ' + bfps.__version__) + parser.add_argument( + 'base_class', + choices = ['NavierStokes', + 'FluidConvert', + 'FluidResize'], + type = str) + opt = parser.parse_args(sys.argv[1:2]) + l = eval('Launcher(base_class = {0})'.format(opt.base_class)) + l(sys.argv[2:]) return None if __name__ == '__main__':