wiki/PagesPerso: ~ n'est pas expansé sur niomniom
Retour à une solution plus crade … dommage.
This commit is contained in:
parent
9b3898835a
commit
c0ace05c79
1 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,7 @@ import os
|
||||||
|
|
||||||
class AccountList:
|
class AccountList:
|
||||||
home = "/home"
|
home = "/home"
|
||||||
www = "/www"
|
www = "www"
|
||||||
url = "http://perso.crans.org/%s/"
|
url = "http://perso.crans.org/%s/"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -12,7 +12,8 @@ class AccountList:
|
||||||
|
|
||||||
def comptes(self):
|
def comptes(self):
|
||||||
"""Retourne la liste des comptes"""
|
"""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"))
|
os.listdir(u"/home/mail"))
|
||||||
### ^^^^^^ le code m'a tuer
|
### ^^^^^^ le code m'a tuer
|
||||||
|
|
||||||
|
@ -51,7 +52,8 @@ class Account:
|
||||||
def __init__(self, home, login, www, url):
|
def __init__(self, home, login, www, url):
|
||||||
"""Instanciation avec le `login' de la personne"""
|
"""Instanciation avec le `login' de la personne"""
|
||||||
self.login = login
|
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.www = www
|
||||||
self.url = url
|
self.url = url
|
||||||
|
|
||||||
|
@ -89,7 +91,7 @@ class Account:
|
||||||
logo = self.info("logo").replace("%s/" % self.chemin(), "")
|
logo = self.info("logo").replace("%s/" % self.chemin(), "")
|
||||||
else:
|
else:
|
||||||
logo = self.info("logo")
|
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"%s%s" % (self.url % self.login, logo)
|
||||||
return u"http://perso.crans.org/pageperso.png"
|
return u"http://perso.crans.org/pageperso.png"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue