r252788 - imsvdex/trunk/imsvdex

"Tom Gross" <svn-changes-z4DKO/[email protected]> Tue, 27 May 2014 10:12:10 +0000 (UTC)
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: tom_gross
Date: Tue May 27 10:12:09 2014
New Revision: 252788

Modified:
   imsvdex/trunk/imsvdex/vdex.py
Log:
use dictonary comprehension


Modified: imsvdex/trunk/imsvdex/vdex.py
==============================================================================
--- imsvdex/trunk/imsvdex/vdex.py	(original)
+++ imsvdex/trunk/imsvdex/vdex.py	Tue May 27 10:12:09 2014
@@ -269,10 +269,7 @@
         """
         returns a dictionary with all translations keyed by language
         """
-        result = {}
-        for element in elements:
-            result[element.get('language')] = element.text
-        return result
+        return { element.get('language'): element.text for element in elements }
 
     def getTermById(self, identifier):
         """

------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk