SF.net SVN: fclient:[783] trunk/fclient/src/fclient/impl/lib/fcp2/lib/ pmstruct.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-27 13:11:55
|
Revision: 783
http://fclient.svn.sourceforge.net/fclient/?rev=783&view=rev
Author: jUrner
Date: 2008-07-27 13:12:04 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
add get() method
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py 2008-07-27 12:11:44 UTC (rev 782)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py 2008-07-27 13:12:04 UTC (rev 783)
@@ -122,6 +122,12 @@
raise ValueError('no such field: %r' % kws.keys()[0])
+ def get(self, name, default=None):
+ try:
+ return self[name]
+ except KeyError:
+ return default
+
def __getitem__(self, name):
return self.values[name]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|