Commits

Marcin Kasperski committed 5f5bc4c

Contexts are saved as labels, not icons (icons are not in fashion anymore)

Comments (0)

Files changed (1)

src/mekk/nozbe2xmind/xmind_writer.py

     contexts = yield nozbe_client.get_contexts()
     print "   DONE."
 
-    context_hash_to_icon = dict( [ (c['hash'], "icon-%s.png" % c['icon']) for c in contexts ] ) 
+    #context_hash_to_icon = dict( [ (c['hash'], "icon-%s.png" % c['icon']) for c in contexts ] ) 
+    context_hash_to_obj = dict( (c['hash'], c) for c in contexts )
 
     print "Loading actions (it may take a few minutes if you have many)..."
     all_actions = yield nozbe_client.get_tasks()
                 a_topic.add_marker(RECUR_MARK)
             c_hash = action['context_hash']
             if c_hash:
-                c_mark = marker_gen.give_mark(context_hash_to_icon.get(c_hash, None))
-                if c_mark:
-                    a_topic.add_marker(c_mark)
+                a_topic.set_label(context_hash_to_obj[c_hash]['name'])
+                #c_mark = marker_gen.give_mark(context_hash_to_icon.get(c_hash, None))
+                #if c_mark:
+                #    a_topic.add_marker(c_mark)
 
     # Legenda.
     legend = sheet.get_legend()
     legend.add_marker(DONE_MARK, "Done")
     legend.add_marker(SHARED_MARK, "Shared")
     legend.add_marker(RECUR_MARK, "Recurring")
-    if contexts:
-        for c in contexts:
-            c_mark = marker_gen.give_mark("icon-%s.png" % c["icon"])
-            if c_mark:
-                legend.add_marker(c_mark, c["name"])
+    # Not adding context icons anymore, they aren't in fashion 
+    #if contexts:
+    #    for c in contexts:
+    #        c_mark = marker_gen.give_mark("icon-%s.png" % c["icon"])
+    #        if c_mark:
+    #            legend.add_marker(c_mark, c["name"])
 
     # Legenda po raz drugi (potrzebne by xmind użył wszystkich ikonek)
     if p_topic: