diff --git a/README.md b/README.md index 8b7ce8cbb..f34ae7c0d 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ and don't need server configurations. pixi global update mss + #### Project installation Initialize a new project and navigate to the project directory. diff --git a/docs/development.rst b/docs/development.rst index 02676ab7a..f9642f76d 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -155,7 +155,7 @@ MSS repository needs a different folder, e.g. workspace/MSS. Avoid to mix data a :ref:`demodata ` is provided by executing:: - mswms_demodata --seed + mswms --seed To use this data add the mswms_settings.py in your python path:: diff --git a/docs/installation.rst b/docs/installation.rst index 942c2b98f..addfe1abf 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -180,6 +180,6 @@ You can start server and client by loading the image :: $ singularity build -f mss.sif Singularity.def $ singularity shell mss.sif $ Singularity > msui # starts the ui - $ Singularity > mswms_demodata --seed # creates in your $HOME a mss/ folder with testdata + $ Singularity > mswms --seed # creates in your $HOME a mss/ folder with testdata $ Singularity > export PYTHONPATH=$HOME/mss; mswms # starts the development server $ Singularity > mscolab db --init; mscolab start # starts the mscolab development server diff --git a/docs/mswms.rst b/docs/mswms.rst index bf006e48c..717e2bb4b 100644 --- a/docs/mswms.rst +++ b/docs/mswms.rst @@ -27,7 +27,7 @@ Simulated Data and its configuration ------------------------------------ -We provide demodata by executing the :code:`mswms_demodata --seed` program. This creates in your home directory +We provide demodata by executing the :code:`mswms --seed` program. This creates in your home directory data files and also the needed server configuration files. The program creates 70MB of examples. This script does not overwrite an existing mswms_settings.py. diff --git a/mslib/mswms/demodata.py b/mslib/mswms/demodata.py index 1fe94de20..681772726 100644 --- a/mslib/mswms/demodata.py +++ b/mslib/mswms/demodata.py @@ -1235,8 +1235,6 @@ def main(): """ parser = argparse.ArgumentParser() parser.add_argument("-v", "--version", help="show version", action="store_true", default=False) - parser.add_argument("-s", "--seed", help="creates demodata for the mswms server", - action="store_true", default=False) args = parser.parse_args() if args.version: print("***********************************************************************") @@ -1245,16 +1243,6 @@ def main(): print("Documentation: http://mss.rtfd.io") print("Version:", __version__) sys.exit() - if args.seed: - root_fs = fs.open_fs("~/") - if not root_fs.exists("mss/testdata"): - root_fs.makedirs("mss/testdata") - - examples = DataFiles(data_fs=fs.open_fs("~/mss/testdata"), - server_config_fs=fs.open_fs("~/mss")) - examples.create_server_config(detailed_information=True) - examples.create_data() - print("\nTo use this setup you need the mswms_settings.py in your python path e.g. \nexport PYTHONPATH=~/mss") if __name__ == '__main__': diff --git a/mslib/mswms/mswms.py b/mslib/mswms/mswms.py index b73fe9d5b..72e070ea6 100644 --- a/mslib/mswms/mswms.py +++ b/mslib/mswms/mswms.py @@ -32,6 +32,8 @@ from mslib import __version__ from mslib.utils import setup_logging from mslib.mswms.wms import app as application +from mslib.mswms.demodata import DataFiles +import fs def main(): @@ -44,6 +46,8 @@ def main(): parser.add_argument("--debug", help="show debugging log messages on console", action="store_true", default=False) parser.add_argument("--logfile", help="If set to a name log output goes to that file", dest="logfile", default=None) + parser.add_argument("-s", "--seed", help="creates demodata for the mswms server", + action="store_true", default=False) subparsers = parser.add_subparsers(help='Available actions', dest='action') gallery = subparsers.add_parser("gallery", help="Subcommands surrounding the gallery") @@ -84,6 +88,17 @@ def main(): print("Documentation: http://mss.rtfd.io") print("Version:", __version__) sys.exit() + + if args.seed: + root_fs = fs.open_fs("~/") + if not root_fs.exists("mss/testdata"): + root_fs.makedirs("mss/testdata") + + examples = DataFiles(data_fs=fs.open_fs("~/mss/testdata"), + server_config_fs=fs.open_fs("~/mss")) + examples.create_server_config(detailed_information=True) + examples.create_data() + print("\nTo use this setup you need the mswms_settings.py in your python path e.g. \nexport PYTHONPATH=~/mss") setup_logging(args) diff --git a/setup.py b/setup.py index 322495cd9..5d5899ecc 100644 --- a/setup.py +++ b/setup.py @@ -38,8 +38,7 @@ "mss = mslib.msui.mss:main", "mssautoplot = mslib.utils.mssautoplot:main", "msui = mslib.msui.msui:main", - "mswms = mslib.mswms.mswms:main", - "mswms_demodata = mslib.mswms.demodata:main"] + "mswms = mslib.mswms.mswms:main",] if os.name != 'nt': console_scripts.append('msidp = mslib.msidp.idp:main')