Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/properties.py
diff options
context:
space:
mode:
authorJCTutorius <charlie@tutorius-dev.(none)>2009-12-27 19:32:14 (GMT)
committer JCTutorius <charlie@tutorius-dev.(none)>2009-12-27 19:32:14 (GMT)
commita1e4d136f860b03abcafc7bf2e2d65b412bc13cd (patch)
tree09089d1ea59fd3b5fdce0b5ab64a842108b6001c /tutorius/properties.py
parentc37cd77ae2b3be4cd216d5ffd3130f1e8fb1663c (diff)
parent6d1cf01b2b20a8deabb6bde44777e9823b0201ce (diff)
Merge branch 'master' of gitorious@git.sugarlabs.org:tutorius/mainlineHEADmaster
Diffstat (limited to 'tutorius/properties.py')
-rw-r--r--tutorius/properties.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/tutorius/properties.py b/tutorius/properties.py
index a0d63bb..1905117 100644
--- a/tutorius/properties.py
+++ b/tutorius/properties.py
@@ -36,7 +36,9 @@ from .propwidgets import PropWidget, \
EventTypePropWidget, \
IntPropWidget, \
FloatPropWidget, \
- IntArrayPropWidget
+ IntArrayPropWidget, \
+ ResourcePropWidget, \
+ ScreenClipPropWidget
import logging
LOGGER = logging.getLogger("properties")
@@ -372,6 +374,9 @@ class TResourceProperty(TutoriusProperty):
TFileProperties with absolute paths, so that they can be used on any
machine.
"""
+
+ widget_class = ResourcePropWidget
+
def __init__(self, resource_name=""):
"""
Creates a new resource pointing to an existing resource.
@@ -386,6 +391,26 @@ class TResourceProperty(TutoriusProperty):
self.default = self.validate("")
+class TScreenClipProperty(TResourceProperty):
+ """
+ Represents an image resource from a screen capture
+
+ When the system encounters a resource, it knows that it refers to a file in
+ the resource folder and that it should translate this resource name to an
+ absolute file name before it is executed.
+ """
+
+ widget_class = ScreenClipPropWidget
+
+ def __init__(self, *args, **kwargs):
+ """
+ Creates a new resource pointing to an existing resource.
+
+ @param resource_name The file name of the resource (should be only the
+ file name itself, no directory information)
+ """
+ super(TScreenClipProperty, self).__init__(*args, **kwargs)
+
class TEnumProperty(TutoriusProperty):
"""
Represents a value in a given enumeration. This means that the value will