key correction
authorYves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Mon, 31 Jan 2011 06:52:18 +0100
changeset 32 c924e143576f
parent 31 93fd53a97d6d
child 33 0f2c04b0944e
key correction
script/lib/iri_tweet/utils.py
--- a/script/lib/iri_tweet/utils.py	Sun Jan 30 22:10:59 2011 +0100
+++ b/script/lib/iri_tweet/utils.py	Mon Jan 31 06:52:18 2011 +0100
@@ -36,6 +36,8 @@
     ts = email.utils.parsedate_tz(date_str)
     return datetime.datetime(*ts[0:7])
 
+def clean_keys(dict_val):
+    return dict([(str(key),value) for key,value in dict_val.items()])
 
 fields_adapter = {
     'stream': {
@@ -143,7 +145,9 @@
 
     def __process_entity(self, ind, ind_type):
         logging.debug("Process_entity : " + repr(ind) + " : " + repr(ind_type))
-    
+        
+        ind = clean_keys(ind)
+        
         entity_dict = {
            "indice_start": ind["indices"][0],
            "indice_end"  : ind["indices"][1],