[gedit/new-message-bus] Override Gedit.Message to allow more convenient access to properties



commit 721d7481b964e1e9f10fbe9a91d2db16a2974573
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Wed Mar 23 23:08:26 2011 +0100

    Override Gedit.Message to allow more convenient access to properties

 gedit/Gedit.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gedit/Gedit.py b/gedit/Gedit.py
index 7603583..db95657 100644
--- a/gedit/Gedit.py
+++ b/gedit/Gedit.py
@@ -32,4 +32,14 @@ class MessageBus(Gedit.MessageBus):
 MessageBus = override(MessageBus)
 __all__.append('MessageBus')
 
+class Message(Gedit.Message):
+    def __getattribute__(self, name):
+        try:
+            return Gedit.Message.__getattribute__(self, name)
+        except:
+            return getattr(self.props, name)
+
+Message = override(Message)
+__all__.append('Message')
+
 # vi:ex:ts=4:et



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]