| 
            Last change
 on this file since 34:ea8b7fdd203d was             21:41e7bbc16e32, checked in by Borja Lopez <borja@…>, 13 years ago           | 
        
        
          | 
             
Improved the mailjam-mta and mailjam-server scripts, adding argparse 
definitions for the proper parameters available for both scripts. 
 
           | 
        
        
          | 
            
           | 
        
        
          | 
            File size:
            685 bytes
           | 
        
      
      
| Line |   | 
|---|
| 1 | #!/usr/bin/env python
 | 
|---|
| 2 | #
 | 
|---|
| 3 | # Run the Mailjam XML-RPC server
 | 
|---|
| 4 | #
 | 
|---|
| 5 | 
 | 
|---|
| 6 | import argparse
 | 
|---|
| 7 | 
 | 
|---|
| 8 | from mailjam.daemon import MailjamDaemon
 | 
|---|
| 9 | 
 | 
|---|
| 10 | msg = 'mailjam-server: Mailing lists management server'
 | 
|---|
| 11 | parser = argparse.ArgumentParser(description=msg)
 | 
|---|
| 12 | parser.add_argument('-c', '--config', action='store', dest='config',
 | 
|---|
| 13 |                     help='Set the path to a valid mailjam configuration file')
 | 
|---|
| 14 | parser.add_argument('-v', '--version', action='version',
 | 
|---|
| 15 |                     version='mailjam server 0.1.0')
 | 
|---|
| 16 | 
 | 
|---|
| 17 | if __name__ == '__main__':
 | 
|---|
| 18 |     results = parser.parse_args()
 | 
|---|
| 19 |     if results.config:
 | 
|---|
| 20 |         daemon = MailjamDaemon(configfile=results.config)
 | 
|---|
| 21 |     else:
 | 
|---|
| 22 |         daemon = MailjamDaemon()
 | 
|---|
| 23 |     daemon.run()
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.