Skip to content
13 changes: 13 additions & 0 deletions mslib/mswms/mswms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -86,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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when this is now copied here and we won´t call mswms_demodata any more the main function of demodata can be removed.

setup.py needs changes

and the docs need changes too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok lemme make the changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi do i need to remove the entire main funtion?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should not be more copy/paste duplicated code.


setup_logging(args)

Expand Down