diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-31 14:51:03 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-31 14:51:03 (GMT) |
commit | 6ff99c9cbc7dbd8ef5f544c778d907f846d22ff5 (patch) | |
tree | 4ea7b109c5386b6a71493535d429a200ae83b08d /python/__init__.py | |
parent | 74e8cfc71fdd862f107683cfa5bab38a1de16adc (diff) |
Ensure the profile directory exists
Diffstat (limited to 'python/__init__.py')
-rw-r--r-- | python/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py index 55758a0..35ac97a 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -15,6 +15,8 @@ # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. +import os + import gtk from hulahop._hulahop import shutdown @@ -24,6 +26,11 @@ _XO_DPI = 200.0 def startup(profile_path, components_dirs=[]): _hulahop.set_profile_path(profile_path) + if not os.path.isdir(profile_path): + try: + os.makedirs(profile_path) + except OSError, exc: + raise RuntimeError('Could not create user directory.') for path in components_dirs: _hulahop.add_components_path(path) |