Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/activity.py12
-rw-r--r--sugar/activity/activityfactoryservice.py2
-rw-r--r--sugar/datastore/datastore.py2
-rw-r--r--sugar/graphics/style.py8
-rw-r--r--sugar/graphics/xocolor.py2
5 files changed, 22 insertions, 4 deletions
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py
index 2c887b9..262d89b 100644
--- a/sugar/activity/activity.py
+++ b/sugar/activity/activity.py
@@ -305,6 +305,18 @@ class Activity(Window, gtk.Container):
def _internal_jobject_error_cb(self, err):
logging.debug("Error creating activity datastore object: %s" % err)
+ def get_activity_root(self):
+ """
+ Return the appropriate location in the fs where to store activity related
+ data that doesn't pertain to the current execution of the activity and
+ thus cannot go into the DataStore.
+ """
+ if os.environ.has_key('SUGAR_ACTIVITY_ROOT') and \
+ os.environ['SUGAR_ACTIVITY_ROOT']:
+ return os.environ['SUGAR_ACTIVITY_ROOT']
+ else:
+ return '/'
+
def read_file(self, file_path):
"""
Subclasses implement this method if they support resuming objects from
diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py
index 8b1397f..63265a1 100644
--- a/sugar/activity/activityfactoryservice.py
+++ b/sugar/activity/activityfactoryservice.py
@@ -30,6 +30,7 @@ from sugar.activity.bundle import Bundle
from sugar.activity import activityhandle
from sugar import logger
from sugar import _sugarext
+from sugar import env
# Work around for dbus mutex locking issue
gobject.threads_init()
@@ -156,6 +157,7 @@ def run(bundle_path):
gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
os.environ['SUGAR_BUNDLE_PATH'] = bundle_path
+ os.environ['SUGAR_ACTIVITY_ROOT'] = env.get_profile_path(bundle.get_service_name())
_sugarext.set_prgname(bundle.get_service_name())
_sugarext.set_application_name(bundle.get_name())
diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py
index 1fbe615..5ba994d 100644
--- a/sugar/datastore/datastore.py
+++ b/sugar/datastore/datastore.py
@@ -140,14 +140,12 @@ class DSObject(object):
activityfactory.create_with_object_id(service_name, object_id)
def destroy(self):
- logging.debug('DSObject.destroy() file_path: %r.' % self._file_path)
if self._destroyed:
logging.warning('This DSObject has already been destroyed!.')
import pdb;pdb.set_trace()
return
self._destroyed = True
if self._file_path and self._owns_file:
- logging.debug('Removing temp file: %r' % self._file_path)
if os.path.isfile(self._file_path):
os.remove(self._file_path)
self._owns_file = False
diff --git a/sugar/graphics/style.py b/sugar/graphics/style.py
index a5186da..c0094b6 100644
--- a/sugar/graphics/style.py
+++ b/sugar/graphics/style.py
@@ -15,14 +15,20 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import os
+
import gtk
import pango
def _get_screen_dpi():
xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi')
- return float(xft_dpi / 1024)
+ return float(xft_dpi / 1024)
def _compute_zoom_factor():
+ if os.environ.has_key('SUGAR_XO_STYLE'):
+ if os.environ['SUGAR_XO_STYLE'] == 'yes':
+ return 1.0
+
return gtk.gdk.screen_width() / 1200.0
def zoom(units):
diff --git a/sugar/graphics/xocolor.py b/sugar/graphics/xocolor.py
index 3ab029f..ff5a2b5 100644
--- a/sugar/graphics/xocolor.py
+++ b/sugar/graphics/xocolor.py
@@ -82,7 +82,7 @@ _colors = [
['#F8E800', '#807500'], \
['#BE9E00', '#F8E800'], \
['#F8E800', '#BE9E00'], \
-['#FFFA00', '#F8E800'], \
+['#FFFA00', '#EDDE00'], \
['#008009', '#F8E800'], \
['#F8E800', '#008009'], \
['#00EA11', '#F8E800'], \