# Copyright 1999-2012. Parallels IP Holdings GmbH. All Rights Reserved.
import sys

MAILMAN_PATH = sys.argv[1]
sys.path.append(MAILMAN_PATH)

import string

from Mailman import MailList
from Mailman import Errors

def main():
    listname = sys.argv[2]
    listname = string.lower(listname)
    try:
        mlist = MailList.MailList(listname, lock=0)
        print mlist.password
    except Errors.MMListError, e:
        print listname + ' is not found'
        sys.exit(1)

if __name__ == '__main__':
    main()
