class CubesDimension:
  def __init__(self, name, label, levels):
    if not isinstance(name, str):
      raise ValueError('name should be a str value', name)
    if not isinstance(label, unicode):
      raise ValueError('label should be a unicode value', label) 
    if len(levels) and not isinstance(levels[0], str):
      raise ValueError('levels should be an array of str', levels)
    self.name = name
    self.label = label
    self.levels = levels

print 'Loading app.json...'
app_json = codecs.open(config_dir + '/app.json', 'r', encoding).read()
app.appjson = json.loads(app_json)
app.debug = app.appjson.get('debug_mode') or False

print 'Loading labels.json...'
labels_json = codecs.open(config_dir + '/labels.json', 'r', encoding).read()
app.labels = json.loads(labels_json)

# Cubes Model
print 'Loading Cubes Model...'
cubes_conn = httplib.HTTPConnection(
  app.appjson.get('cubes_hostname') or 'localhost',
  app.appjson.get('cubes_port') or 5000 
)
try: 
  cubes_conn.request('GET', "/model")
except Exception, e: