3 # Copyright 2007 - 2009, VEB IT |
3 # Copyright 2007 - 2009, VEB IT |
4 # See COPYING for distribution information. |
4 # See COPYING for distribution information. |
5 |
5 |
6 """This is the vmm main script.""" |
6 """This is the vmm main script.""" |
7 |
7 |
8 from VirtualMailManager.constants.VERSION import * |
|
9 |
|
10 import locale |
|
11 # do it early - for importing in the other files |
|
12 locale.setlocale(locale.LC_ALL, '') |
|
13 ENCODING = locale.nl_langinfo(locale.CODESET) |
|
14 |
|
15 def w_std(*args): |
|
16 for arg in args: |
|
17 os.sys.stdout.write(arg.encode(ENCODING, 'replace')) |
|
18 os.sys.stdout.write('\n') |
|
19 |
|
20 import os |
|
21 import gettext |
8 import gettext |
22 from time import strftime, strptime |
9 from time import strftime, strptime |
23 |
10 |
|
11 from VirtualMailManager import * |
24 from VirtualMailManager.VirtualMailManager import VirtualMailManager |
12 from VirtualMailManager.VirtualMailManager import VirtualMailManager |
25 import VirtualMailManager.Exceptions as VMME |
13 import VirtualMailManager.Exceptions as VMME |
26 import VirtualMailManager.constants.EXIT as EXIT |
14 import VirtualMailManager.constants.EXIT as EXIT |
27 import VirtualMailManager.constants.ERROR as ERR |
15 |
28 |
|
29 |
|
30 def w_err(code, *args): |
|
31 for arg in args: |
|
32 os.sys.stderr.write(arg.encode(ENCODING, 'replace')) |
|
33 os.sys.stderr.write('\n') |
|
34 os.sys.exit(code) |
|
35 |
16 |
36 def usage(excode=0, errMsg=None): |
17 def usage(excode=0, errMsg=None): |
37 u_head = _(u"""\ |
18 u_head = _(u"""\ |
38 Usage: %s SUBCOMMAND OBJECT ARGS* |
19 Usage: %s SUBCOMMAND OBJECT ARGS* |
39 short long |
20 short long |