From 61edb0f742604cd3cc2dc9895cf679765b9b899e Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 09 Nov 2009 03:10:11 +0000 Subject: Merge branch 'lp435984' of ../mainline Conflicts: addons/gtkwidgeteventfilter.py addons/readfile.py addons/timerevent.py tests/probetests.py tests/run-tests.py tutorius/TProbe.py tutorius/bundler.py tutorius/core.py tutorius/creator.py tutorius/dbustools.py tutorius/engine.py tutorius/filters.py tutorius/properties.py tutorius/service.py --- diff --git a/addons/readfile.py b/addons/readfile.py index 9fe2f81..d3b5d76 100644 --- a/addons/readfile.py +++ b/addons/readfile.py @@ -16,9 +16,9 @@ import os -from ..actions import Action -from ..properties import TFileProperty -from ..services import ObjectStore +from .actions import Action +from .properties import TFileProperty +from .services import ObjectStore class ReadFile(Action): filename = TFileProperty(None) diff --git a/addons/timerevent.py b/addons/timerevent.py index 752a865..cb312c4 100644 --- a/addons/timerevent.py +++ b/addons/timerevent.py @@ -16,8 +16,8 @@ import gobject -from ..filters import EventFilter -from ..properties import TIntProperty +from .filters import EventFilter +from .properties import TIntProperty class TimerEvent(EventFilter): """ diff --git a/data/icons/Layer 1.svg b/data/icons/Layer 1.svg new file mode 100644 index 0000000..e7d9e2b --- /dev/null +++ b/data/icons/Layer 1.svg @@ -0,0 +1,6 @@ + + +]> + + \ No newline at end of file diff --git a/data/icons/clock.sugar.svg b/data/icons/clock.sugar.svg new file mode 100644 index 0000000..0334c1a --- /dev/null +++ b/data/icons/clock.sugar.svg @@ -0,0 +1,1593 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/tests/enginetests.py b/tests/enginetests.py new file mode 100644 index 0000000..60a68f4 --- /dev/null +++ b/tests/enginetests.py @@ -0,0 +1,30 @@ +# Copyright (C) 2009, Tutorius.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 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 +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import unittest + +import dbus + +session_bus = dbus.SessionBus() + +ENGINE_BUS_NAME = "org.tutorius.engine" + +LAUNCH_PATH = "/launch" +STOP_PATH = "/stop" +PAUSE_PATH = "/pause" + +class EngineInterfaceTests(unittest.TestCase): + pass diff --git a/tests/translatortests.py b/tests/translatortests.py index e71b795..3b5ca6f 100644 --- a/tests/translatortests.py +++ b/tests/translatortests.py @@ -21,6 +21,7 @@ import uuid from sugar.tutorius.translator import * from sugar.tutorius.properties import * from sugar.tutorius.tutorial import * +from sugar.tutorius.vault import Vault from sugar.tutorius import addon ############################################################################## @@ -97,8 +98,6 @@ class ResourceTranslatorTests(unittest.TestCase): self.translator = ResourceTranslator(self.prob_man, self.tutorial_id) - pass - def tearDown(self): Vault.deleteTutorial(self.tutorial_id) @@ -113,6 +112,8 @@ class ResourceTranslatorTests(unittest.TestCase): assert getattr(res_action, "resource").type == "file", "Resource was not converted to file" + assert res_action.resource.default == Vault.get_resource_path(self.tutorial_id, self.res_name), "Transformed resource path is not the same as the one given by the vault" + def test_recursive_translate(self): nested_action = NestedResource() @@ -127,3 +128,4 @@ class ResourceTranslatorTests(unittest.TestCase): for container in list_action.nested_list: assert getattr(container, "resource").type == "file", "Element of list was not converted properly" + diff --git a/tutorius/translator.py b/tutorius/translator.py index 4e3e88d..626e2c9 100644 --- a/tutorius/translator.py +++ b/tutorius/translator.py @@ -33,7 +33,7 @@ class ResourceTranslator(object): An architectural note : every different type of translation should have its own method (translate_resource, etc...), and this function must be called - from the translate method, under the type test. The translation_* method + from the translate method, under the type test. The translate_* method must take in the input property and give the output property that should replace it. """ -- cgit v0.9.1