Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2012-08-28 22:15:47 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2012-08-28 22:15:47 (GMT)
commit74b64a7616ef57a2b81dfe77159b67456ee7a76a (patch)
tree08ec007719dc83e70d7d2c6c34d90373b0d41db7
parentf34e1f55aa55748d5091af95e3c81af2cd5a107f (diff)
Update Sweetener
-rwxr-xr-x[-rw-r--r--]evaluate (copied from toolbars.py)32
-rwxr-xr-xevaluate.py37
-rw-r--r--options.py (renamed from toolbars.py)0
3 files changed, 35 insertions, 34 deletions
diff --git a/toolbars.py b/evaluate
index b906fb4..5220d2a 100644..100755
--- a/toolbars.py
+++ b/evaluate
@@ -1,13 +1,12 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-#
-# Copyright 2012 S. Daniel Francis <francis@sugarlabs.org>
-#
+#!/bin/bash
+#
+# Copyright 2012 Daniel Francis <francis@sugarlabs.org>
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -17,18 +16,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
+#
-from gettext import gettext as _
-import gobject
-import gtk
-
-from sweetener.itembox import ItemBox
-from sweetener.basic_options import BasicOptions
-
+# Don't modify this Script, it's auto-generated.
-class Options(ItemBox):
- def __init__(self, activity):
- ItemBox.__init__(self, activity)
- self.activity = activity
- self.basic = BasicOptions(activity, self,
- [])
+export PYTHONPATH=$PYTHONPATH:./desktop
+export DATADIR=programabspath/data
+export ICONDIR=programabspath/desktop/icons
+python evaluate.py
diff --git a/evaluate.py b/evaluate.py
index a8bb7e5..ad92521 100755
--- a/evaluate.py
+++ b/evaluate.py
@@ -22,29 +22,38 @@ import os
import logging
logging.basicConfig(level=logging.DEBUG)
from gettext import gettext as _
+
import glib
import info
logger = logging.getLogger(info.lower_name)
-
appname = info.name
# Some desktops like Gnome3-Shell show the Glib Prgname
glib.set_prgname(appname)
-import gtk
+glib.set_application_name(appname)
-try:
- from sweetener.basic_options import DOCUMENT
-except ImportError:
- import sys
- sys.path.append(os.path.abspath('./desktop'))
- from sweetener.basic_options import DOCUMENT
-
-os.environ['DATA_DIR'] = os.path.abspath('./data')
-
-from toolbars import Options
+import gtk
+from options import Options
from canvas import Canvas
-icon_theme = gtk.icon_theme_get_default()
-icon_theme.append_search_path(os.path.abspath('./desktop/icons'))
+this_dir = os.path.split(__file__)[:-1]
+if len(this_dir) == 1 and this_dir[0] == '':
+ this_dir = os.path.abspath('./')
+else:
+ this_dir = os.path.join(this_dir)
+logger.debug(this_dir)
+
+if 'programabspath' in os.environ['DATADIR']:
+ datadir = os.environ['DATADIR'].replace('programabspath',
+ this_dir)
+else:
+ datadir = os.environ['DATADIR']
+
+if os.environ['ICONDIR'] != 'SYSTEM':
+ logger.debug(this_dir)
+ icondir = os.environ['ICONDIR'].replace('programabspath',
+ this_dir)
+ icon_theme = gtk.icon_theme_get_for_screen(gtk.gdk.screen_get_default())
+ icon_theme.append_search_path(icondir)
class UnfullscreenButton(gtk.Window):
diff --git a/toolbars.py b/options.py
index b906fb4..b906fb4 100644
--- a/toolbars.py
+++ b/options.py