[Skencil-commits] r729 - skencil/branches/skencil-0.6/src/Sketch/Scripting
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Sep 22 23:53:18 CEST 2010
Author: igor_n
Date: 2010-09-22 23:53:17 +0200 (Wed, 22 Sep 2010)
New Revision: 729
Modified:
skencil/branches/skencil-0.6/src/Sketch/Scripting/wrapper.py
Log:
mixed indents are removed
Modified: skencil/branches/skencil-0.6/src/Sketch/Scripting/wrapper.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/Scripting/wrapper.py 2010-09-22 21:52:57 UTC (rev 728)
+++ skencil/branches/skencil-0.6/src/Sketch/Scripting/wrapper.py 2010-09-22 21:53:17 UTC (rev 729)
@@ -26,30 +26,30 @@
class UndoMethodWrapper:
def __init__(self, method, document):
- self.method = method
- self.document = document
+ self.method = method
+ self.document = document
def __call__(self, *args, **kw):
- self.document.AddUndo(apply(self.method, args, kw))
+ self.document.AddUndo(apply(self.method, args, kw))
class ObjectMethodWrapper:
def __init__(self, method, document):
- self.method = method
- self.document = document
+ self.method = method
+ self.document = document
def __call__(self, *args, **kw):
- return ObjectWrapper(apply(self.method, args, kw), self.document)
+ return ObjectWrapper(apply(self.method, args, kw), self.document)
class ObjectListMethodWrapper:
def __init__(self, method, document):
- self.method = method
- self.document = document
+ self.method = method
+ self.document = document
def __call__(self, *args, **kw):
- objects = apply(self.method, args, kw)
- return map(ObjectWrapper, objects, (self.document,) * len(objects))
+ objects = apply(self.method, args, kw)
+ return map(ObjectWrapper, objects, (self.document,) * len(objects))
# special methods (__*__) which can be called safely
@@ -61,13 +61,13 @@
"__repr__": 1,
"__str__": 1,
"__coerce__": 1,
- }
-
+}
+
class Wrapper:
def __init__(self, object, document):
- self._object = object
- self._document = document
+ self._object = object
+ self._document = document
def __getattr__(self, attr):
try:
@@ -77,19 +77,19 @@
warn(USER,'Cant access attribute %s of %s in safe user script',
attr, self._object)
raise AttributeError, attr
- if access == SCRIPT_UNDO:
- return UndoMethodWrapper(getattr(self._object, attr),
- self._document)
- elif access == SCRIPT_GET:
- return getattr(self._object, attr)
- elif access == SCRIPT_OBJECT:
- return ObjectMethodWrapper(getattr(self._object, attr),
- self._document)
- elif access == SCRIPT_OBJECTLIST:
- return ObjectListMethodWrapper(getattr(self._object, attr),
- self._document)
- else:
- raise AttributeError, attr
+ if access == SCRIPT_UNDO:
+ return UndoMethodWrapper(getattr(self._object, attr),
+ self._document)
+ elif access == SCRIPT_GET:
+ return getattr(self._object, attr)
+ elif access == SCRIPT_OBJECT:
+ return ObjectMethodWrapper(getattr(self._object, attr),
+ self._document)
+ elif access == SCRIPT_OBJECTLIST:
+ return ObjectListMethodWrapper(getattr(self._object, attr),
+ self._document)
+ else:
+ raise AttributeError, attr
def __cmp__(self, other):
return cmp(self._object, strip_wrapper(other))
@@ -104,14 +104,14 @@
class DocumentWrapper(Wrapper):
def __init__(self, document):
- Wrapper.__init__(self, document, document)
+ Wrapper.__init__(self, document, document)
def SelectObject(self, objects, mode = SelectSet):
- if type(objects) == ListType:
- objects = map(strip_wrapper, objects)
- else:
- objects = strip_wrapper(objects)
- self._document.SelectObject(objects, mode)
+ if type(objects) == ListType:
+ objects = map(strip_wrapper, objects)
+ else:
+ objects = strip_wrapper(objects)
+ self._document.SelectObject(objects, mode)
def DeselectObject(self, object):
self._document.DeselectObject(strip_wrapper(object))
@@ -119,9 +119,9 @@
def Insert(self, object, undo_text = _("Create Object")):
self._document(strip_wrapper(object), undo_text)
-
+
#
ObjectWrapper = Wrapper
More information about the Skencil-commits
mailing list