Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Dreiundzwanzig
Copy link

@Dreiundzwanzig Dreiundzwanzig commented Jun 20, 2021

Add options to:

  • add specific centers or doctors

Closes #68, closes #82

@Dreiundzwanzig Dreiundzwanzig changed the title Add option to add specific center and option to exclude center Add option to add specific center or doctor Jul 7, 2021
doctoshotgun.py Outdated Show resolved Hide resolved
Co-authored-by: gitolicious <[email protected]>
@rbignon
Copy link
Owner

rbignon commented Jul 18, 2021

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?

@Dreiundzwanzig
Copy link
Author

Dreiundzwanzig commented Jul 18, 2021

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',
Copy link
Collaborator

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):
Copy link
Collaborator

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?

Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vaccination centres in Berlin not addressable? Book specific Doctor/Center
4 participants