62 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Python
		
	
	
| # -*- coding: utf-8 -*-
 | |
| 
 | |
| from .config_tza import ConfigTZA
 | |
| from .config_glaser import ConfigGlaser
 | |
| 
 | |
| class Environment():
 | |
|     def __init__(self, host, port, dbname, username, pwd=None, super_admin_pw=None, demo=False, config=False):
 | |
|         self.host = host
 | |
|         self.port = port
 | |
|         self.dbname = dbname
 | |
|         self.username = username
 | |
|         # The password for the user named username
 | |
|         # During create the user is created with this password,
 | |
|         # otherwise it's used to authenticate during login.
 | |
|         self.pwd = pwd
 | |
|         self.super_admin_pw = super_admin_pw
 | |
|         self.demo = demo
 | |
|         self.config = config
 | |
| 
 | |
|     def __str__(self):
 | |
|         return """==============================
 | |
| Host:     %s
 | |
| User:     %s
 | |
| DB:       %s
 | |
| Port:     %s
 | |
| ==============================""" % (self.host, self.username, self.dbname, self.port)
 | |
| 
 | |
| 
 | |
| ENVIRONMENTS = {
 | |
|     # Local environments are listed with passwords
 | |
|     'tzdev'       : Environment('http://10.1.2.195', "8080", "tz-austria_1", "admin",        "x", "admin", config = ConfigTZA()),
 | |
|     'tzdev-tz'    : Environment('http://10.1.2.195', "8080", "tz-austria_1", "tz-admin",     "x", "admin", config = ConfigTZA()),
 | |
|     'tzdev-glaser': Environment("http://10.1.2.195", "8080", "tz-austria_1", "glaser-admin", "x", "admin", config = ConfigGlaser()),
 | |
| 
 | |
|     'oa'          : Environment('http://localhost',  "8080", "tz-austria_1", "admin",        "x", "admin", config = ConfigTZA()),
 | |
|     'oa-tz'       : Environment('http://localhost',  "8080", "tz-austria_1", "tz-admin",     "x", "admin", config = ConfigTZA()),
 | |
|     'oa-glaser'   : Environment('http://localhost',  "8080", "tz-austria_1", "glaser-admin", "x", "admin", config = ConfigGlaser()),
 | |
| 
 | |
|     'br'          : Environment('http://localhost',  '8080', 'tz-austria_1', 'admin',        'x', 'admin', config = ConfigTZA()),
 | |
|     'br-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()),
 | |
|     'br-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
 | |
| 
 | |
|     'aa'          : Environment('http://localhost',  '8080', 'tz-austria_2', 'admin',        'x', 'admin', config = ConfigTZA()),
 | |
|     'aa-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()),
 | |
|     'aa-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_2', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
 | |
| 
 | |
|     'rw'          : Environment('http://localhost',  '8080', 'tz-austria_1', 'admin',        'x', 'admin', config = ConfigTZA()),
 | |
|     'rw-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()),
 | |
|     'rw-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()),
 | |
| 
 | |
|     # Remote environments are always listed without passwords!
 | |
|     # Do not store them here, you have to type them anyway!
 | |
|     'test': Environment('https://erp.tzaustria.info', '443', 'odoo-test', 'admin', config = ConfigTZA()),
 | |
|     'test-glaser': Environment('https://erp.tzaustria.info',  '443', 'odoo-test', 'glaser-admin', config = ConfigGlaser()),
 | |
| 
 | |
|     'demo': Environment('https://solutions.tzaustria.info', '443', 'odoo-demo', 'admin', config = ConfigTZA()),
 | |
|     'demo-glaser': Environment('https://solutions.tzaustria.info',  '443', 'odoo-demo', 'glaser-admin', config = ConfigGlaser()),
 | |
| 
 | |
|     'prod': Environment('http://localhost', '9002', 'odoo-prod', 'admin', config = ConfigTZA()),
 | |
|     'prod-glaser': Environment('http://localhost',  '9002', 'odoo-prod', 'glaser-admin', config = ConfigGlaser()),
 | |
| }
 |