homes: plus de généricité & /home-adh/x/xlogin
This commit is contained in:
parent
de45237b50
commit
20a6ee6afb
6 changed files with 15 additions and 14 deletions
|
@ -10,8 +10,8 @@ class ClubList(PagesPerso.AccountList):
|
|||
|
||||
def comptes(self):
|
||||
"""Retourne la liste des comptes"""
|
||||
return filter(lambda x: os.path.isdir(u"/home/club/%s" % x) and not os.path.islink(u"/home/club/%s" % x),
|
||||
os.listdir(u"/home/club"))
|
||||
return filter(lambda x: os.path.isdir(u"/home/c/club/%s" % x) and not os.path.islink(u"/home/c/club/%s" % x),
|
||||
os.listdir(u"/home/c/club"))
|
||||
|
||||
def execute(macro, args):
|
||||
return macro.formatter.rawHTML(ClubList().to_html())
|
||||
|
|
|
@ -12,8 +12,9 @@ class AccountList:
|
|||
|
||||
def comptes(self):
|
||||
"""Retourne la liste des comptes"""
|
||||
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
|
||||
|
||||
|
||||
def makeAnchor(self,letter):
|
||||
|
@ -50,7 +51,7 @@ class Account:
|
|||
def __init__(self, home, login, www, url):
|
||||
"""Instanciation avec le `login' de la personne"""
|
||||
self.login = login
|
||||
self.home = "%s/%s" % (home, login)
|
||||
self.home = os.path.expanduser("~%s" % login)
|
||||
self.www = www
|
||||
self.url = url
|
||||
|
||||
|
@ -78,7 +79,7 @@ class Account:
|
|||
|
||||
def chemin(self):
|
||||
"""Chemin vers le www"""
|
||||
return u"%s%s" % (self.home, self.www)
|
||||
return os.path.join(self.home, self.www)
|
||||
|
||||
def logo(self):
|
||||
"""URL du logo s'il y en a un"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue