From 6499e6802abf7315e3e516ed76345ad066dfe65f Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Mon, 13 Jul 2015 09:33:09 +0200 Subject: [PATCH] robots.txt: rajoute toujours / initial --- utils/robots_perso.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/robots_perso.py b/utils/robots_perso.py index 1f8212d7..2d74b90e 100755 --- a/utils/robots_perso.py +++ b/utils/robots_perso.py @@ -19,8 +19,11 @@ def add_robots(user, robots): for user_agent in entry.useragents: for rule in entry.rulelines: what = "Allow" if rule.allowance else "Disallow" - robots["User-agent: %s" % user_agent][what].append("/%s%s" % (user, rule.path)) - robots["User-agent: %s" % user_agent][what].append("/~%s%s" % (user, rule.path)) + path = rule.path + if not path.startswith('/'): + path = '/' + path + robots["User-agent: %s" % user_agent][what].append("/%s%s" % (user, path)) + robots["User-agent: %s" % user_agent][what].append("/~%s%s" % (user, path)) def write_robots(file, robots): for user_agent, whats in robots.items():