-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add option to add specific center or doctor #83
base: master
Are you sure you want to change the base?
Add option to add specific center or doctor #83
Conversation
b370403
to
5d4c2ae
Compare
5d4c2ae
to
b684ab4
Compare
Co-authored-by: gitolicious <[email protected]>
Hello, Thank you for your patch. However, I think it is not user friendly to ask user providing the name and city, as the url is enough to guess them. In my opinion, the code may be a little refactored to not apply args filters (--center, --center-regex, etc.) on ones provided with --aditional-center. Another question related to the usecase itself, do you really want to add these centers to the search results, or are you targeting specifically these centers? Perhaps instead of --additional-center, it would be --center-url and in this case, do not do any search at all? |
Hello, i've added them to the search result, because at the time of writing the code i didn't want to introduce as as little as possible merge conflicts, but thats not neccesary anymore if it ever was. My personal usecase was to add additional centers/doctors from which i knew there offering vaccinations, but are not included in the search results and i wanted them to be processed additionally to the search results. You are right, i've refactored the code and removed requirement for name and city. |
@@ -653,6 +663,8 @@ def main(self, cli_args=None): | |||
action='append', help='exclude centers') | |||
parser.add_argument('--center-exclude-regex', | |||
action='append', help='exclude centers by regex') | |||
parser.add_argument('--additional-center', '-ac', |
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.
Until now, we only had single-letter abbreviations for arguments but it looks like we are running out of usable letters. Still it should be a deliberate decision to extend to two-letter abbreviations. @rbignon what do you think?
@@ -617,6 +617,16 @@ def setup_loggers(self, level): | |||
logging.root.setLevel(level) | |||
logging.root.addHandler(self.create_default_logger()) | |||
|
|||
def try_to_book_or_sleep(self, docto, center, vaccine_list, start_date, end_date, only_second, only_third, dry_run=False): |
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.
To me the method name is a bit misleading. "or sleep" in fact describes the internal logic of a lazy loading try_to_book || sleep
but from the sound of it I would expect "or sleep" is related to the return value. Maybe someone comes up with a better name?
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.
Yeah your right, i guess we could just use try_to_book
? I mean it's just that and in fact it does not matter if there is a sleep
inside or not. What do you think?
Add options to:
Closes #68, closes #82