Changeset 21:41e7bbc16e32 in mailjam for bin/mailjam-server


Ignore:
Timestamp:
May 22, 2012, 1:29:55 PM (12 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Improved the mailjam-mta and mailjam-server scripts, adding argparse
definitions for the proper parameters available for both scripts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/mailjam-server

    r16 r21  
    11#!/usr/bin/env python
    22#
    3 # Run the Postman XML-RPC server
     3# Run the Mailjam XML-RPC server
     4#
    45
    5 from postman.daemon import PostmanDaemon
     6import argparse
     7
     8from mailjam.daemon import MailjamDaemon
     9
     10msg = 'mailjam-server: Mailing lists management server'
     11parser = argparse.ArgumentParser(description=msg)
     12parser.add_argument('-c', '--config', action='store', dest='config',
     13                    help='Set the path to a valid mailjam configuration file')
     14parser.add_argument('-v', '--version', action='version',
     15                    version='mailjam server 0.1.0')
    616
    717if __name__ == '__main__':
    8     daemon = PostmanDaemon()
     18    results = parser.parse_args()
     19    if results.config:
     20        daemon = MailjamDaemon(configfile=results.config)
     21    else:
     22        daemon = MailjamDaemon()
    923    daemon.run()
Note: See TracChangeset for help on using the changeset viewer.