From 73f074e7f5359319f79c8c9a9555eed77866c729 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 26 Sep 2009 02:35:42 +0000 Subject: add exception for running outside of Sugar --- diff --git a/taproject.py b/taproject.py index b3663ef..6d31f93 100644 --- a/taproject.py +++ b/taproject.py @@ -1,7 +1,7 @@ #Copyright (c) 2007-8, Playful Invention Company. #Copyright (c) 2008-9, Walter Bender -#Permission is hereby granted, free of charge, to any person obtaining a copy +#Permission is hereby granted, free of chargae, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -45,7 +45,10 @@ import os.path from tasprites import * from taturtle import * from talogo import stop_logo -from sugar.datastore import datastore +try: + from sugar.datastore import datastore +except: + pass nolabel = ['audiooff', 'descriptionoff','journal'] shape_dict = {'journal':'texton', \ diff --git a/tasetup.py b/tasetup.py index e6799f7..131e8bc 100644 --- a/tasetup.py +++ b/tasetup.py @@ -329,7 +329,10 @@ def setup_selector(tw,name,y,blockdescriptions): return spr def load_image(path, dir, file): - from sugar.activity import activity + try: + from sugar.activity import activity + except: + pass try: datapath = os.path.join(activity.get_activity_root(), "data") diff --git a/tawindow.py b/tawindow.py index 0424093..56c6621 100644 --- a/tawindow.py +++ b/tawindow.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- #Copyright (c) 2007, Playful Invention Company -#Copyright (c) 2008-9, Walter Bender +#Copyright (c) 2008-9, Walter Bendera #Copyright (c) 2009, Raúl Gutiérrez Segalés #Permission is hereby granted, free of charge, to any person obtaining a copy @@ -43,7 +43,10 @@ from tasprites import * from talogo import * from taturtle import * from taproject import * -from sugar.graphics.objectchooser import ObjectChooser +try: + from sugar.graphics.objectchooser import ObjectChooser +except: + pass from tahoverhelp import * from gettext import gettext as _ -- cgit v0.9.1