robots.txt: rajoute toujours / initial
This commit is contained in:
parent
d3677b832a
commit
6499e6802a
1 changed files with 5 additions and 2 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue