Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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
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.