[gedit/new-message-bus] Override Gedit.Message to allow more convenient access to properties
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/new-message-bus] Override Gedit.Message to allow more convenient access to properties
- Date: Wed, 23 Mar 2011 22:08:40 +0000 (UTC)
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]