libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1103040 - /incubator/libcloud/trunk/libcloud/utils.py
Date Sat, 14 May 2011 11:14:12 GMT
Author: tomaz
Date: Sat May 14 11:14:11 2011
New Revision: 1103040

URL: http://svn.apache.org/viewvc?rev=1103040&view=rev
Log:
Add reverse_dict utility function.

Modified:
    incubator/libcloud/trunk/libcloud/utils.py

Modified: incubator/libcloud/trunk/libcloud/utils.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/utils.py?rev=1103040&r1=1103039&r2=1103040&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/utils.py (original)
+++ incubator/libcloud/trunk/libcloud/utils.py Sat May 14 11:14:11 2011
@@ -176,6 +176,9 @@ def findattr(element, xpath, namespace):
 def findall(element, xpath, namespace):
     return element.findall(fixxpath(xpath=xpath, namespace=namespace))
 
+def reverse_dict(dictionary):
+    return dict([ (value, key) for key, value in dictionary.iteritems() ])
+
 def get_driver(drivers, provider):
     """
     Get a driver.



Mime
View raw message