robots_perso: oubli d'un os.*path*.expanduser

This commit is contained in:
Daniel STAN 2014-09-01 00:11:03 +02:00
parent 096a243c77
commit 8248887f9c

View file

@ -11,7 +11,7 @@ robots_file = '/usr/scripts/var/perso/robots.txt'
robots = collections.defaultdict(lambda:collections.defaultdict(list)) robots = collections.defaultdict(lambda:collections.defaultdict(list))
def add_robots(user, robots): def add_robots(user, robots):
robots_path = os.expanduser('~%s/www/robots.txt' % user) robots_path = os.path.expanduser('~%s/www/robots.txt' % user)
if os.path.exists(robots_path): if os.path.exists(robots_path):
rp = robotparser.RobotFileParser() rp = robotparser.RobotFileParser()
rp.parse(open(robots_path)) rp.parse(open(robots_path))