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