source: mailjam/bin/mailjam-cli@ 35:dccf85c165a8

Last change on this file since 35:dccf85c165a8 was 23:adc5b22efd7e, checked in by Borja Lopez <borja@…>, 13 years ago

Added the first version of the CLI client, which implements a shell-like
interface where users can interact with a mailjam server.

This first versions adds no "big" features, but contains the basis to build
a complete shell interface (including history saving support, completion,
help for commands, etc)

Added a custom configuration file (conf/mailjam-cli.conf) for the CLI
client.

Added a new mailjam.config class (CLIClientConfig) that is used by the CLI
client to load its configuration file.

Updated the package information (setup.py, MANIFEST) to include the CLI
client data.

Modified the behaviour of the XMLRPC methods registered in the *XMLRPC classes
within the daemon module. Now instead of raising exceptions directly, they
catch such exceptions, returning only a string representation of the error
to the XMLRPC client. If there is no error, a nice "ok" message is returned.

  • Property exe set to *
File size: 684 bytes
RevLine 
[23]1#!/usr/bin/env python
2#
3# Run the Mailjam CLI client
4
5import argparse
6from mailjam.cli import CLIClient
7
8msg = 'mailjam-cli: Mailing lists CLI client'
9parser = argparse.ArgumentParser(description=msg)
10parser.add_argument('-c', '--config', action='store', dest='config',
11 help='Set the path to a valid mailjam cli client configuration file')
12parser.add_argument('-v', '--version', action='version',
13 version='mailjam cli client 0.1.0')
14
15if __name__ == '__main__':
16 results = parser.parse_args()
17 if results.config:
18 cli_client = CLIClient(configfile=results.config)
19 else:
20 cli_client = CLIClient()
21 cli_client.cmdloop()
Note: See TracBrowser for help on using the repository browser.