Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-03-18 12:48:34 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-03-18 12:48:34 (GMT)
commit154a0e91ffece83fd1e7ef836c6faaa83166e93c (patch)
tree8c9ccfd4326cd646352f29a9389c3d3ebd401d49 /sugar
parent3fd29884f952ea96fcc003b9611c83612759a64b (diff)
Create ~/Activities only when necessary
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/bundlebuilder.py8
-rw-r--r--sugar/env.py5
2 files changed, 5 insertions, 8 deletions
diff --git a/sugar/activity/bundlebuilder.py b/sugar/activity/bundlebuilder.py
index 120e7b8..be1d200 100644
--- a/sugar/activity/bundlebuilder.py
+++ b/sugar/activity/bundlebuilder.py
@@ -92,9 +92,6 @@ def _get_bundle_dir():
def _get_install_dir(prefix):
return os.path.join(prefix, 'share/activities')
-def _get_bundle_path():
- return os.path.join(env.get_user_activities_path(), _get_bundle_dir())
-
def _get_package_name():
bundle = Bundle(_get_source_path())
zipname = '%s-%d.xo' % (bundle.get_name(), bundle.get_activity_version())
@@ -120,7 +117,10 @@ setup.py help - print this message \n\
'
def cmd_dev():
- bundle_path = os.path.join(env.get_user_activities_path(), _get_bundle_dir())
+ bundle_path = env.get_user_activities_path()
+ if not os.path.isdir(bundle_path):
+ os.mkdir(bundle_path)
+ bundle_path = os.path.join(bundle_path, _get_bundle_dir())
try:
os.symlink(_get_source_path(), bundle_path)
except OSError:
diff --git a/sugar/env.py b/sugar/env.py
index 4938940..2acdcb9 100644
--- a/sugar/env.py
+++ b/sugar/env.py
@@ -53,10 +53,7 @@ def get_profile_path(path=None):
return base
def get_user_activities_path():
- path = os.path.expanduser('~/Activities')
- if not os.path.isdir(path):
- os.mkdir(path)
- return path
+ return os.path.expanduser('~/Activities')
def get_bin_path(path=None):
return _get_prefix_path('bin', path)