diff options
author | florent <florent.pigout@gmail.com> | 2011-08-27 22:55:40 (GMT) |
---|---|---|
committer | florent <florent.pigout@gmail.com> | 2011-08-27 22:55:40 (GMT) |
commit | 1ed5c27368c76eec33c03fed6ea6d837dc567776 (patch) | |
tree | 3a209f820b027617d8074f2ae15d7e16fe4ea0c1 | |
parent | 1d60cc141a1c13d3f7f60bf9ab171907bf8a6132 (diff) |
fix bad path management
-rw-r--r-- | lib/server/flask/_app.py | 5 | ||||
-rw-r--r-- | nutrinoweb/controllers/database_manager.py | 3 | ||||
-rw-r--r-- | run.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/server/flask/_app.py b/lib/server/flask/_app.py index f4b8096..995c532 100644 --- a/lib/server/flask/_app.py +++ b/lib/server/flask/_app.py @@ -24,8 +24,9 @@ try: BUNDLE = activity.get_bundle_path() ROOT = activity.get_activity_root() except Exception, e: - BUNDLE = '.' - ROOT = '.' + BUNDLE = os.path.abspath(os.path.join( + os.path.dirname(__file__), '..', '..', '..')) + ROOT = BUNDLE # init app app = flask.Flask(__name__) diff --git a/nutrinoweb/controllers/database_manager.py b/nutrinoweb/controllers/database_manager.py index 6d0a2ca..5213413 100644 --- a/nutrinoweb/controllers/database_manager.py +++ b/nutrinoweb/controllers/database_manager.py @@ -51,6 +51,9 @@ app.config.from_envvar('NUTRINOWEB_SETTINGS', silent=True) def connect_db(database): """Returns a new connection to the database.""" try: + print DATABASE1 + print DATABASE2 + print DATABASE3 if database == 'nutrition': return sqlite3.connect(DATABASE1) elif database == 'activity': @@ -6,7 +6,7 @@ try: from sugar.activity import activity BUNDLE = activity.get_bundle_path() except Exception, e: - BUNDLE = '.' + BUNDLE = os.path.dirname(__file__) # add lib path to current python path sys.path.append(os.path.join(BUNDLE, 'lib')) |