-
Notifications
You must be signed in to change notification settings - Fork 6
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
Avoid code repetition between import_info and import_info_from_list #14
Labels
refactor
Changes to code without affecting functionality
Comments
jvfe
added a commit
to jvfe/pyorcidator
that referenced
this issue
Apr 10, 2022
- Instead of repeating code between import info from list and import info, include a type guard on import_info to check if the argument provided is a path or a just a string. - Addresses lubianat#14
40126eb shows how I'd go about implementing what I said above. If you want I can open a PR with it. |
Looks better, @jvfe! a PR would be great |
jvfe
added a commit
to jvfe/pyorcidator
that referenced
this issue
Apr 15, 2022
- Instead of repeating code between import info from list and import info, include a type guard on import_info to check if the argument provided is a path or a just a string. - Addresses lubianat#14
jvfe
added a commit
to jvfe/pyorcidator
that referenced
this issue
Apr 15, 2022
- Keeps both commands, but refactors repeated functionality into a separate function. - Also improves the way the path to the ORCID file is read - Also adds missing open_browser to import_list - Closes lubianat#14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the end result between the modules is essentially the same, the functionality desired - to read from a list of ORCIDs - could be achieved by having a type guard on import_info.py, to see if the argument provided is a Path() that exists - thereby reading it and looping through them - or a string - in such case, only sending it to render_orcid_qs. I believe it would make the code simpler and cleaner.
The text was updated successfully, but these errors were encountered: