def handle(self, *args, **options): # Load dynamic configs - the middleware is not working here, so do this manually config.load_app_configs() self.stdout.write(colored.cyan('Retrieving Olap servers...')) self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Olap servers defined in the Vique configuration:')) self.stdout.write('') try: for key, values in config.OLAP_SERVERS.iteritems(): connection_succesfull = test_olap_server_connection(values['url'], values['username'], values['password']) self.stdout.write(colored.cyan('Name : ') + key) self.stdout.write(colored.cyan('URL : ') + values['url']) self.stdout.write(colored.cyan('Username : '******'username']) self.stdout.write(colored.cyan('Password : '******'password']) self.stdout.write(colored.cyan('Connection succesfull : ') + connection_succesfull) self.stdout.write('') self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Finished retrieving Olap servers')) except Exception: self.stdout.write(colored.red('An error occured when retrieving Olap servers from Vique'))
def handle(self, *args, **options): # Load dynamic configs - the middleware is not working here, so do this manually config.load_app_configs() self.stdout.write(colored.cyan('Retrieving Olap datasets...')) self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Olap datasets defined in the Vique configuration:')) self.stdout.write('') try: for key, values in config.OLAP_DATASETS.iteritems(): olap_datasource = config.OLAP_DATASOURCES[values['olap_datasource']] olap_server = config.OLAP_SERVERS[olap_datasource['olap_server']] try: connection_succesfull = test_olap_dataset(olap_server['url'], olap_server['username'], olap_server['password'], olap_datasource['datasource_info'], values['cube']) except: connection_succesfull = False self.stdout.write(colored.cyan('Name : ') + key) self.stdout.write(colored.cyan('Olap server : ') + olap_datasource['olap_server']) self.stdout.write(colored.cyan('Datasource info : ') + olap_datasource['datasource_info']) self.stdout.write(colored.cyan('Cube : ') + values['cube']) self.stdout.write(colored.cyan('Connection succesfull : ') + connection_succesfull) self.stdout.write('') self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Finished retrieving Olap datasets')) except Exception: self.stdout.write(colored.red('An error occured when retrieving Olap datasets from Vique'))
def handle(self, *args, **options): # Load dynamic configs - the middleware is not working here, so do this manually config.load_app_configs() self.stdout.write(colored.cyan('Retrieving Olap level relations...')) self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Olap level relations defined in the Vique configuration:')) self.stdout.write('') try: for key, values in config.OLAP_LEVEL_RELATIONS.iteritems(): self.stdout.write(colored.cyan('Level : ') + key) self.stdout.write(colored.cyan('Geodataset : ') + values['geo_dataset'].__name__) self.stdout.write('') self.stdout.write(colored.cyan('__________________________________________________________________')) self.stdout.write(colored.cyan('Finished retrieving Olap level relations')) except Exception: self.stdout.write(colored.red('An error occured when retrieving Olap level relations from Vique'))
def process_request(self, request): # Load vique.py configuration settings for all modules config.load_app_configs()