Skip to content

Commit

Permalink
cast lists to sets in case leo_cloud did the reverse
Browse files Browse the repository at this point in the history
leo_cloud stores nodes in JSON format, which can't store sets, so it
stores them as lists instead

Leo build: 20171121091156
  • Loading branch information
tbnorth committed Nov 21, 2017
1 parent 6a5f13b commit fec44e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions leo/core/commit_timestamp.json
@@ -1,4 +1,4 @@
{
"asctime": "Tue Nov 21 02:21:37 CST 2017",
"timestamp": "20171121022137"
"asctime": "Tue Nov 21 09:11:56 CST 2017",
"timestamp": "20171121091156"
}
6 changes: 4 additions & 2 deletions leo/plugins/nodetags.py
Expand Up @@ -201,15 +201,17 @@ def get_tags(self, v):
#@+node:peckj.20140804103733.9260: *4* add_tag
def add_tag(self, v, tag):
''' adds 'tag' to the taglist of v '''
tags = v.u.get(self.TAG_LIST_KEY, set([]))
# cast to set() incase JSON storage (leo_cloud plugin) converted to list
tags = set(v.u.get(self.TAG_LIST_KEY, set([])))
tags.add(tag)
v.u[self.TAG_LIST_KEY] = tags
self.c.setChanged(True)
self.update_taglist(tag)
#@+node:peckj.20140804103733.9261: *4* remove_tag
def remove_tag(self, v, tag):
''' removes 'tag' from the taglist of v '''
tags = v.u.get(self.TAG_LIST_KEY, set([]))
# cast to set() incase JSON storage (leo_cloud plugin) converted to list
tags = set(v.u.get(self.TAG_LIST_KEY, set([])))
if tag in tags:
tags.remove(tag)
if tags:
Expand Down

0 comments on commit fec44e0

Please sign in to comment.