You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PDBList::retrieve_pdb_file overpowers the API user #1064
This VERY HANDY funcion is doing three things that are inconvenient
It prints messages to the console, like "Downloading PDB structure 'XXXX'..."
It saves the data into a local file
it generates an exception instead of returning an error code.
My suggestion is to use callback functions for
messaging
for the downloaded content
For messaging do not use any specific languaje, use an message id
For the downloaded content, let the user decide where to put it (e.g a file or on a database, or even send it forward .. you name it)
OBS. You do not need to to make this function obsolete, just create a more open version using callback functions, where the default would be to print to the console if no callback is provided
@riemaxi Could you extend on using callback functions to messaging or downloaded content?
For messaging I think that move the print function/statement to the logging module would be useful, since you can set verbosity and hide the messages.
For the downloaded content, you mean return a plain text, instead of creating a file and let the user save the text in a file or passing it to another function, class, etc.? Maybe this is useful too, a parameter that let you decide if you want to receive it as a text or save it directly. For instance, if you don't specify a path parameter.
Hi hector
Thanks for answering.
Yes of course I can do that ... would be a pleasure.
I would however, avoid parameters and use only a functional approach, so we
keep a clean implementation and at the same time we let the user decide by
passing its own functions.
The current implementation can be based on this new, so everybody is happy
... :-) ...
//Sam
Activity
hectormartinezdev commentedon Mar 14, 2017
@riemaxi Could you extend on using callback functions to messaging or downloaded content?
For messaging I think that move the print function/statement to the logging module would be useful, since you can set verbosity and hide the messages.
For the downloaded content, you mean return a plain text, instead of creating a file and let the user save the text in a file or passing it to another function, class, etc.? Maybe this is useful too, a parameter that let you decide if you want to receive it as a text or save it directly. For instance, if you don't specify a
pathparameter.riemaxi commentedon Mar 14, 2017