Commit d498a0b3 authored by mouadh's avatar mouadh

remove try catch

parent 44a31ef6
......@@ -16,12 +16,7 @@ class MyDB(object):
# raise Exception('Missing database config file')
def __init__(self,
username='postgres',
password='root',
db=None,
host='localhost'
):
def __init__(self,db=None):
# TODO temporary
db_config = DbConfigParser()
......@@ -31,10 +26,11 @@ class MyDB(object):
host = db_credentials['host']
if db is None:
# first i want to show all databases to user (in excel)
self.connection = pg.connect("user={0} password={1} host='{2}'".
format(username, password, host))
else:
# and then we connect to the user db
try:
self.connection = pg.connect(
"user={0} password={1} dbname='{2}' host='{3}'".format(
......
......@@ -89,13 +89,10 @@ else:
home_directory = expanduser("~")
if not os.path.isdir(os.path.join(home_directory, 'olapy-data', 'cubes')):
try:
os.makedirs(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref = zipfile.ZipFile('cubes_templates/cubes_temp.zip', 'r')
zip_ref.extractall(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref.close()
except:
raise Exception('unable to create cubes directory !')
os.makedirs(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref = zipfile.ZipFile('cubes_templates/cubes_temp.zip', 'r')
zip_ref.extractall(os.path.join(home_directory, 'olapy-data', 'cubes'))
zip_ref.close()
if not os.path.isfile(os.path.join(home_directory, 'olapy-data','olapy-config.xml')):
copyfile('config/olapy-config.xml', os.path.join(home_directory, 'olapy-data','olapy-config.xml'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment