-
Notifications
You must be signed in to change notification settings - Fork 183
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
Enhancement request: move pyDAL to local import #234
Comments
hm, but wouldn't that cause a fail if someone started slow and didn't use the sql functionality, but then did so? we would be banking on the idea that they know how to deal with an import error in Python. |
You can catch the failed import error and print guidance on how to proceed to stdout.
|
... and I just learned a new one. This day already paid off, thanks! |
In OWASP#234 @colesmj suggested to move the import of pydal into the sqlDumb function. This commit does this and if the import fails raises an UIError with an explanation on how to proceed. The text is just a first draft. To move the import the function get_table was also moved inside the sqlDump function.
In OWASP#234 @colesmj suggested to move the import of pydal into the sqlDumb function. This commit does this and if the import fails raises an UIError with an explanation on how to proceed. The text is just a first draft. To move the import the function get_table was also moved inside the sqlDump function.
I think this can be closed now. |
pyDAL is used for only 1 purpose within 1 function - pytm.py:1175
SQLDump()
For readability and to reduce pre-installation requirements for likely most users, consider making the import of pyDAL currently on pytm.py:24 be local to
SQLDump()
. This is allowed by Python and means if no one usesSQLDump()
pyDAL is never loaded; otherwise it is a requirement and always loaded even if never used.The text was updated successfully, but these errors were encountered: