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
Nounous
Crans Passwords
Commits
691bc29f
Commit
691bc29f
authored
Apr 12, 2013
by
Vincent Le gallic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicodification
parent
8d4cda9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
server.py
server.py
+7
-11
No files found.
server.py
View file @
691bc29f
...
...
@@ -38,7 +38,7 @@ def writefile(filename, contents):
"""Écrit le fichier avec les bons droits UNIX"""
os
.
umask
(
0077
)
f
=
open
(
filename
,
'w'
)
f
.
write
(
contents
)
f
.
write
(
contents
.
encode
(
"utf-8"
)
)
f
.
close
()
def
listroles
():
...
...
@@ -87,7 +87,7 @@ def putfile(filename):
old
=
getfile
(
filename
)
oldroles
=
old
[
'roles'
]
except
TypeError
:
old
=
"[Création du fichier]"
old
=
u
"[Création du fichier]"
pass
else
:
if
not
validate
(
oldroles
,
'w'
):
...
...
@@ -134,19 +134,15 @@ def notification(subject, corps, fname, old):
tomail
=
DEST_MAIL
msg
=
MIMEMultipart
(
_charset
=
"utf-8"
)
msg
[
'Subject'
]
=
subject
msg
[
'X-Mailer'
]
=
"cranspasswords"
msg
[
'X-Mailer'
]
=
u
"cranspasswords"
msg
[
'From'
]
=
CRANSP_MAIL
msg
[
'To'
]
=
DEST_MAIL
msg
.
preamble
=
"cranspasswords report"
msg
.
preamble
=
u
"cranspasswords report"
info
=
MIMEText
(
corps
+
"
\n
La version précédente a été sauvegardée."
+
#"\nCi-joint l'ancien fichier." +
"
\n\n
--
\n
Cranspasswords.py"
,
_charset
=
"utf-8"
)
u
"
\n
La version précédente a été sauvegardée."
+
u
"
\n\n
--
\n
Cranspasswords.py"
,
_charset
=
"utf-8"
)
msg
.
attach
(
info
)
#old = MIMEText(old)
#old.add_header('Content-Disposition', 'attachment', filename=fname)
#msg.attach(str(old))
conn
.
sendmail
(
frommail
,
tomail
,
msg
.
as_string
())
conn
.
sendmail
(
frommail
,
tomail
,
msg
.
as_string
())
conn
.
quit
()
WRITE_COMMANDS
=
[
"putfile"
,
"rmfile"
]
...
...
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