Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Maud Kerebel
scripts
Commits
c0ace05c
Commit
c0ace05c
authored
Aug 29, 2014
by
Daniel STAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wiki/PagesPerso: ~ n'est pas expansé sur niomniom
Retour à une solution plus crade … dommage.
parent
9b389883
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
wiki/macro/PagesPerso.py
wiki/macro/PagesPerso.py
+6
-4
No files found.
wiki/macro/PagesPerso.py
View file @
c0ace05c
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment