[IMP] hw_proxy: initial commit for the posbox's documentation
[odoo/odoo.git] / openerpcommand / conf.py
1 """
2 Display the currently used configuration. The configuration for any
3 sub-command is normally given by options. But some options can be specified
4 using environment variables. This sub-command shows those variables.
5 A `set` sub-command should be provided when the configuration is in a real
6 configuration file instead of environment variables.
7 """
8 import os
9 import sys
10 import textwrap
11
12 def run(args):
13     for x in ('database', 'addons', 'host', 'port'):
14         x_ = ('openerp_' + x).upper()
15         if x_ in os.environ:
16             print '%s: %s' % (x, os.environ[x_])
17         else:
18             print '%s: <not set>' % (x, )
19     os.environ['OPENERP_DATABASE'] = 'yeah'
20
21 def add_parser(subparsers):
22     parser = subparsers.add_parser('conf',
23         description='Display the currently used configuration.')
24
25     parser.set_defaults(run=run)