-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Refactoring to improved readibility #132
Conversation
1e465b4
to
3a4b507
Compare
@rroux, @joshuaberetta. You are both assigned as reviewers to test this new version.
|
0e95afa
to
e48a7bc
Compare
- Reorganized methods alphabetically. - "Do not repeat yourself" improvement: added a method to prompt Yes/No questions
… info and success)
`Config.get_template()` (i.e. get rid of `dict.get(value, default)` in favor or `dict[value]`)
e48a7bc
to
165405c
Compare
…backups are deactivated
e346d6c
to
a945dc8
Compare
@noliveleger, as discussed, we are currently getting |
else: | ||
if config.auto_detect_network(): | ||
Template.render(config) | ||
Setup.update_hosts(current_config) | ||
Setup.update_hosts(dict_) | ||
|
||
Command.start() | ||
|
||
|
||
if __name__ == '__main__': |
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.
@noliveleger is there is reason why you decided not to go with something like argparse
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.
Oh! I always thought that argparse
was introduced in Python3. I was wrong.
That would be a good improvement ;-) Let's open another issue for that!
class MockUpgrading: | ||
|
||
@staticmethod | ||
def migrate_single_to_two_databases(config): | ||
pass |
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.
Was this intentionally left for 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.
It's a mock class only used in tests.
The idea is just to make it pass over it without doing anything.
We don't need to upgrade the db during the test :-)
Would you prefer return
instead of pass
?
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.
pass
is good 👍 just checking if you wrote the method name and then forgot to complete it 😄
It does not add any new features.
To do:
Config.TRUE
andConfig.FALSE
in favor of booleans.Config
. It allows to use syntaxdict[property]
more often (instead ofdict.get(property, default)
)shared-database-obsolete
master
On top of #129, close #53