Added a warn message when pydal isn't available
This commit is contained in:
+14
-4
@@ -15,10 +15,20 @@ __all__ = ['A', 'B', 'BEAUTIFY', 'BODY', 'BR', 'CAT', 'CENTER', 'CLEANUP', 'CODE
|
|||||||
#: add pydal to sys.modules
|
#: add pydal to sys.modules
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(os.path.join(
|
try:
|
||||||
os.path.dirname(os.path.abspath(__file__)), "packages", "dal"))
|
sys.path.append(os.path.join(
|
||||||
import pydal
|
os.path.dirname(os.path.abspath(__file__)), "packages", "dal"))
|
||||||
sys.modules['pydal'] = pydal
|
import pydal
|
||||||
|
sys.modules['pydal'] = pydal
|
||||||
|
except:
|
||||||
|
raise RuntimeError(
|
||||||
|
"Seems that you haven't pydal inside your web2py's copy. We are sorry" +
|
||||||
|
" for the inconvenience.\nIf you cloned the repository without " +
|
||||||
|
"'--recursive' option, please run 'git submodule update' inside your " +
|
||||||
|
"web2py copy.\nIf you downloaded the package from github with the " +
|
||||||
|
"download button, please download a released copy from " +
|
||||||
|
"http://www.web2py.com or one attached to the releases on github."
|
||||||
|
)
|
||||||
|
|
||||||
from globals import current
|
from globals import current
|
||||||
from html import *
|
from html import *
|
||||||
|
|||||||
Reference in New Issue
Block a user