1#!/usr/bin/env python
2
3"""
4Wrapper for running singletons from source.
5
6When used with Python 3 (and the DEB and RPM packages of Curator are compiled
7and bundled with Python 3), Curator requires the locale to be unicode. Any of
8the above unicode definitions are acceptable.
9
10To set the locale to be unicode, try:
11
12$ export LC_ALL=en_US.utf8
13$ curator_cli [ARGS]
14
15Alternately, you should be able to specify the locale on the command-line:
16
17$ LC_ALL=en_US.utf8 curator_cli [ARGS]
18
19Be sure to substitute your unicode variant for en_US.utf8
20
21"""
22
23import click
24from curator.singletons import cli
25
26if __name__ == '__main__':
27    try:
28        cli(obj={})
29    except RuntimeError as e:
30        import sys
31        print('{0}'.format(e))
32        sys.exit(1)
33    except Exception as e:
34        if 'ASCII' in str(e):
35            print('{0}'.format(e))
36            print(__doc__)
37