-
Notifications
You must be signed in to change notification settings - Fork 121
feat:command changes #2644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat:command changes #2644
Changes from all commits
4077a89
d3b0a52
ccff85c
d81934e
6525ac5
a57f98a
fab245f
24ee0b5
dead5c2
2a9e619
9ebe5b2
8b2e061
76ba3d7
e65d1ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ and don't need server configurations. | |
|
|
||
| pixi global update mss | ||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is not part of the issue |
||
| #### Project installation | ||
| Initialize a new project and navigate to the project directory. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and what does this? Have you tried the examples?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It adds an argument '-s' or '--seed' to enable data seeding using the mswms command.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and how is the method called? Does it create demodata in a dir as the description says?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no it is not creating
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can u give some hint where to do the changes?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. look in conftest for an example, this creates also demodata for the tests.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi i have added the seed function. Can u jst review it? |
||
|
|
||
| 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") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok lemme make the changes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi do i need to remove the entire main funtion?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should not be more copy/paste duplicated code. |
||
|
|
||
| setup_logging(args) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the changes here?