I wanted to use the w2popenid example application from bitbucket
website : https://bitbucket.org/bottiger/web2py-openid/overview
I have downloaded and placed the code in the applications directory.
I have changed in the models folder the file db.py: this line "from
applications.cas.modules.w2popenid import OpenIDLogin" is replaced
with this one "from w2popenid import OpenIDLogin" or this "from
applications.w2popenid.modules.import OpenIDLogin". But it don't
worked. I get to follow this trace
Traceback (most recent call last):
File "/home/mamadou/Desktop/web2py/gluon/restricted.py", line 192,
in restricted
exec ccode in environment
File "/home/mamadou/Desktop/web2py/applications/w2popenid/models/
db.py", line 42, in <module>
from testing import lala
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
280, in __call__
fromlist, level)
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
in __call__
level)
File "/home/mamadou/Desktop/web2py/applications/w2popenid/modules/
testing.py", line 7, in <module>
import openid.consumer.consumer
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
280, in __call__
fromlist, level)
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
in __call__
level)
File "/usr/lib/pymodules/python2.7/openid/consumer/consumer.py",
line 197, in <module>
from openid.consumer.discover import discover,
OpenIDServiceEndpoint, \
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
280, in __call__
fromlist, level)
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
in __call__
level)
File "/usr/lib/pymodules/python2.7/openid/consumer/discover.py",
line 21, in <module>
from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
280, in __call__
fromlist, level)
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
in __call__
level)
File "/usr/lib/pymodules/python2.7/openid/yadis/etxrd.py", line 28,
in <module>
ElementTree = importElementTree()
File "/usr/lib/pymodules/python2.7/openid/oidutil.py", line 58, in
importElementTree
ElementTree = __import__(mod_name, None, None, ['unused'])
File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
258, in __call__
globals.get("__file__", ""))
AttributeError: 'NoneType' object has no attribute 'get'
to fix i must modify the module custom_import in the web2py/gluon
folder.
starting line 256
try:
caller_file_name = os.path.join(self.web2py_path,
\globals.get("__file__", ""))
except AttributeError:
caller_file_name = ""