remove the print staments in alembic.command #43
Migrated issue, originally created by miniwark NA (@miniwark)
alembic.command use a few print commands to display command results. For example in current function.
If i try to use command.current in another script the version is always printed in the console.
Example script :
This will effectively get the requested version but also print the version with may not be wanted in another script.
suggestion : return a string instead instead of using print
The text was updated successfully, but these errors were encountered:
Michael Bayer (@zzzeek) wrote:
this is true that the informational commands are oriented towards being run in a console. If you want to get the current version, do this:
I don't know how alembic.command could itself be changed without pushing the print statements and message formatting somewhere else. The command-line version of the tasks have to be somewhere, and that's what the "command" package is for. And I definitely wouldn't want to promote the API usage as, " to get the current version, run comand.current(), get the return value as a string, then use a regexp to pull out the number from the middle of the message". command.current is just not oriented towards API usage.
so perhaps the issue here is even promoting alembic.command as public.