Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is basically doing the same thing. Not sure what the difference is. See: https://github.com/ODM2/WOFpy/blob/master/wof/examples/flask/odm2/timeseries/runserver_odm2_timeseries.py#L42
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.
I think maybe a change to specify that one needs to put in the correct path to the
.cfg
would work better.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.
@lsetiawan, FYI, I won't chime in on this unless you ask me to 😉 It would take me a good chunk of digging to be able to say anything intelligent about this. You're the guru here!
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.
@lsetiawan the difference is for me when I did this
dao = Odm2Dao(get_connection('odm2_config_postgresql.cfg'))
this line of code failed with an error but when I added it as the default in the parser argument it worked
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.
@miguelcleon
is basically using the value from
args.config
, which in your change, if the user doesn't specify--config
will be'odm2_config_mysql.cfg'
. So this means thatargs.config
is'odm2_config_mysql.cfg'
. So the runserver script ends up running, which is my original documentation:The breakage comes if
'odm2_config_mysql.cfg'
is not in the same folder as the runserver script. So I think a change of maybe addingos.path.join(config_folder, 'odm2_config_mysql.cfg')
is maybe better and explain that with that, one has to know where the config file lives. or if same folder, one can useos.curdir
.Makes sense? Let me know if that's confusing.
@emiliom do you think changing the default to 'odm2_config_mysql.cfg' is better than straight up changing the function that actually take the value? Thanks.
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.
because
args.config
isNone
on the line I listed aboveThere 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.
so the better change would be:
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.
@lsetiawan yes, that is it 😄
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.
@lsetiawan Seems kind of better to change it in one place rather then two?
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.
That's fine, but you won't be able to show that it should be from absolute path. Maybe I'll change that in the actual runserver script. Thanks!