Commit c0ace05c authored by Daniel Stan's avatar Daniel Stan

wiki/PagesPerso: ~ n'est pas expansé sur niomniom

Retour à une solution plus crade … dommage.
parent 9b389883
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment