Hi Ferran,
In data venerdì 30 novembre 2012 11:52:08, Ferran Jorba ha scritto:
> script = os.path.basename(req.filename)
>
> The «AttributeError: unreadable attribute» is this req.filename, because
> if I replace it with a string, it works.
>
> Is there an alternative for knowing the name of the script? If not,
> I'll hardcode it, no problem.
If you mean to know which path was used in order to reach your script, then
this is available in req.unparsed_uri. You also have req.uri and req.args to
know more of what came, and then the recommended way is what Alexander replied
just afterwards, i.e. to have:
from invenio.urlutils import wash_url_argument
def index(req, param1, param2...)
param1 = wash_url_argument(param1, int)
...
Cheers!
Sam
--
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>