script: fix mailmanUser indent
This commit is contained in:
parent
8fbcb6eedc
commit
1f83da3b74
@ -6,6 +6,7 @@ MAILING_PREFIX="noel"
|
||||
ADMIN_MAIL = "mathieu@mathux.org"
|
||||
ADMIN_PWD = ""
|
||||
|
||||
|
||||
def getListUser(listName):
|
||||
cmd = MAILMAN_HOME+"/list_members "+listName
|
||||
proc = subprocess.Popen(cmd,
|
||||
@ -22,7 +23,6 @@ def getListUser(listName):
|
||||
return stdout.split('\n')
|
||||
|
||||
|
||||
|
||||
def getMailingLists(prefix):
|
||||
cmd = MAILMAN_HOME+"/list_lists -b"
|
||||
proc = subprocess.Popen(cmd,
|
||||
@ -42,8 +42,10 @@ def getMailingLists (prefix):
|
||||
lists.append(line)
|
||||
return lists
|
||||
|
||||
|
||||
def createList(name):
|
||||
cmd = MAILMAN_HOME+"/newlist -a -l fr %s %s %s"%(name,ADMIN_MAIL,ADMIN_PWD)
|
||||
cmd = MAILMAN_HOME + \
|
||||
"/newlist -a -l fr %s %s %s" % (name, ADMIN_MAIL, ADMIN_PWD)
|
||||
proc = subprocess.Popen(cmd,
|
||||
shell=True,
|
||||
stdin=sys.stdin,
|
||||
@ -56,6 +58,7 @@ def createList(name):
|
||||
print "error when creating mailing lists : %s" % stderr
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def listContainsUser(user, listName):
|
||||
return user in getListUser(listName)
|
||||
|
||||
@ -81,7 +84,7 @@ def addUserToList(userEmail, listName):
|
||||
def delUserFromList(userEmail, listName):
|
||||
if not listContainsUser(userEmail, listName):
|
||||
return
|
||||
print "Remove %s to list %s"%(userEmail, listName)
|
||||
print "Remove %s from list %s" % (userEmail, listName)
|
||||
cmd = MAILMAN_HOME+"/remove_members "+listName+" "+userEmail
|
||||
proc = subprocess.Popen(cmd,
|
||||
shell=True,
|
||||
@ -124,4 +127,3 @@ for listName in allButUserList:
|
||||
if len(sys.argv) == 4:
|
||||
for listName in existingLists:
|
||||
delUserFromList(sys.argv[3], listName)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user