Fixed crash when a curency is not available
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 7 May 2011 16:57:31 +0000 (16:57 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sat, 7 May 2011 16:57:31 +0000 (16:57 +0000)
curcy-update

index 6810b29be265638d363a78a8c208a27b59f61453..1613c1dd876a9c4adc005096669f3db658a845cc 100755 (executable)
@@ -41,8 +41,14 @@ def get_yahoo_quotes():
     quotes['USD'] = 1
 
     ref_usd = quotes[REFERENCE]
+    
+    local_quotes = {}
     for cur in quotes.keys():
-        quotes[cur] = ref_usd / quotes[cur]
+        if quotes[cur]:
+            local_quotes[cur] = ref_usd / quotes[cur]
+        else:
+            logging.error('no value for currency %s', cur)
+    quotes = local_quotes
 
     # add historical european values
     if REFERENCE == 'EUR':