Create ~/Activities only when necessary

This commit is contained in:
Marco Pesenti Gritti 2007-03-18 13:48:34 +01:00
parent 3fd29884f9
commit 154a0e91ff
4 changed files with 8 additions and 9 deletions

View File

@ -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:

View File

@ -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)

View File

@ -1,6 +1,6 @@
VERSION=0.63
DATE=`date +%Y%m%d`
RELEASE=2.53
RELEASE=2.55
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
rm sugar-$VERSION.tar.bz2

View File

@ -28,6 +28,8 @@ proxy_obj = bus.get_object(DBUS_SERVICE, DBUS_PATH)
dbus_service = dbus.Interface(proxy_obj, DBUS_SERVICE)
bundle_dir = env.get_user_activities_path()
if not os.path.isdir(bundle_dir):
os.mkdir(bundle_dir)
zip_file = zipfile.ZipFile(sys.argv[1])
file_names = zip_file.namelist()