I'm trying to match DOIs in the requests and I have some problems.
My code is the following.
I have a simple (generic and not complete) regular expression for the
DOIs:
urls = (
'/(doi\:)?10\.[0-9]{4}\/.*','doi',
)
class doi(object):
"""Class that takes care of a DOI"""
def __init__(self):
""" Constructor"""
pass
def GET(self):
"""manager of the get requests"""
print 'doi'
but this code gives me an error if I call my server with the URL
http://localhost:8000/10.1088/0004-637X/726/2
the error is the following:
- - [26/Jan/2011 17:00:19] "HTTP/1.1 GET /101088" - 500 Internal
Server Error
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/web/application.py", line 242, in process
return self.handle()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/web/application.py", line 233, in handle
return self._delegate(fn, self.fvars, args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/web/application.py", line 415, in
_delegate
return handle_class(cls)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/site-packages/web/application.py", line 390, in
handle_class
return tocall(*args)
TypeError: GET() takes exactly 1 argument (2 given)
I'm running python code on Mac OS X 10.5.8 with python 2.5 (port
version).
What's wrong with my code?
I think the problem is in the regular expression, but I cannot figure
out what it is.
Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.