43 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.8 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
 | |
|     'br': 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_1', '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_1', 'glaser-admin', 'x', 'admin', config=ConfigGlaser()),
 | |
|     'oa': Environment('http://localhost', '8080', 'tz-austria_1', 'admin', 'x', 'admin'),
 | |
| 
 | |
|     # Remote environments are always listed without passwords!
 | |
|     # Do not store them here, you have to type them anyway!
 | |
|     'test': Environment('https://tz-austria.datenpol.at', '443', 'tz-austria_1', 'admin'),
 | |
| }
 |