diff --git a/wiki/macro/PagesPerso.py b/wiki/macro/PagesPerso.py index aadd678b..4f331413 100644 --- a/wiki/macro/PagesPerso.py +++ b/wiki/macro/PagesPerso.py @@ -4,7 +4,7 @@ import os class AccountList: home = "/home" - www = "/www" + www = "www" url = "http://perso.crans.org/%s/" def __init__(self): @@ -12,7 +12,8 @@ class AccountList: def comptes(self): """Retourne la liste des comptes""" - return filter(lambda x: os.path.isdir(os.path.expanduser(u"~%s/www" % x)) and not os.path.islink(os.path.expanduser(u"~%s/www" % x)), + return filter(lambda x: os.path.isdir(u"/home/%s/www" % x) and not os.path.islink(u"/home/%s/www" % x), + #return filter(lambda x: os.path.isdir(os.path.expanduser(u"~%s/www" % x)) and not os.path.islink(os.path.expanduser(u"~%s/www" % x)), os.listdir(u"/home/mail")) ### ^^^^^^ le code m'a tuer @@ -51,7 +52,8 @@ class Account: def __init__(self, home, login, www, url): """Instanciation avec le `login' de la personne""" self.login = login - self.home = os.path.expanduser("~%s" % login) + self.home = "%s/%s" % (home, login) + #self.home = #os.path.expanduser("~%s" % login) self.www = www self.url = url @@ -89,7 +91,7 @@ class Account: logo = self.info("logo").replace("%s/" % self.chemin(), "") else: logo = self.info("logo") - if os.path.isfile("%s/%s" % (self.chemin(), logo)): + if os.path.isfile(os.path.join(self.chemin(), logo)): return u"%s%s" % (self.url % self.login, logo) return u"http://perso.crans.org/pageperso.png"