robots.txt: rajoute toujours / initial

This commit is contained in:
Daniel STAN 2015-07-13 09:33:09 +02:00
parent d3677b832a
commit 6499e6802a

View file

@ -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():