[gnome-builder] jedi: ensure directory for sqlite db is available



commit c8d3a5a6f1cf8150e8883d625eef061593be37e1
Author: Christian Hergert <christian hergert me>
Date:   Mon Dec 21 18:51:10 2015 -0800

    jedi: ensure directory for sqlite db is available

 plugins/jedi/jedi_plugin.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index d840564..d6674de 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -191,6 +191,10 @@ class DocumentationDB(object):
         "Open the DB (if needed)"
         if self.db is None:
             doc_db_path = os.path.join(GLib.get_user_data_dir(), 'gnome-builder', 'jedi', 'girdoc.db')
+            try:
+                os.makedirs(os.path.dirname(doc_db_path))
+            except:
+                pass
             self.db = sqlite3.connect(doc_db_path)
             self.cursor = self.db.cursor()
             # Create the tables if they don't exist to prevent exceptions later on


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]