Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common/Config.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-06-06 07:18:26 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-06-06 07:18:36 (GMT)
commit2931f2f1bc98096eb8d270ea467f8244a67e808c (patch)
treefefe7cfbf7edae5790111e84a684e1f4648c1508 /common/Config.py
parent3b162ef806b77cf4bdf85eccd40854479dc222a0 (diff)
Add singular access point for getting image files; add 73% scaled images for resolution <=800
Diffstat (limited to 'common/Config.py')
-rw-r--r--common/Config.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/Config.py b/common/Config.py
index 85fa2bf..75bd43d 100644
--- a/common/Config.py
+++ b/common/Config.py
@@ -6,6 +6,8 @@ import gettext
import logging
from os.path import join
+import gtk
+
from sugar.activity.activity import get_bundle_path, get_activity_root
from sugar import env
@@ -322,3 +324,13 @@ KEY_MAP_NOTPIANO = {24: 24, # Q
57: 48} # N
KEY_MAP = KEY_MAP_PIANO
+
+if max(gtk.gdk.screen_width(), gtk.gdk.screen_height()) <= 800:
+ # Images created using `convert $i -resize 73%` command
+ IMAGE_ROOT = join(IMAGE_ROOT, '73', '')
+
+
+def imagefile(filename):
+ if filename and not filename.startswith(os.sep):
+ filename = IMAGE_ROOT + filename
+ return filename