Show json tags as per FF bookmark convention
This commit is contained in:
parent
a769f71671
commit
4046afb4ea
14
buku
14
buku
@ -943,25 +943,25 @@ def format_json(resultset, single=False):
|
|||||||
marks = []
|
marks = []
|
||||||
for row in resultset:
|
for row in resultset:
|
||||||
if showOpt == 1:
|
if showOpt == 1:
|
||||||
record = { 'url': row[1] }
|
record = { 'uri': row[1] }
|
||||||
elif showOpt == 2:
|
elif showOpt == 2:
|
||||||
record = { 'url': row[1], 'tags': row[3][1:-1] }
|
record = { 'uri': row[1], 'tags': row[3][1:-1] }
|
||||||
else:
|
else:
|
||||||
record = { 'url': row[1], 'title': row[2], 'comment': row[4], 'tags': row[3][1:-1]}
|
record = { 'uri': row[1], 'title': row[2], 'description': row[4], 'tags': row[3][1:-1]}
|
||||||
|
|
||||||
marks.append(record)
|
marks.append(record)
|
||||||
else:
|
else:
|
||||||
marks = {}
|
marks = {}
|
||||||
for row in resultset:
|
for row in resultset:
|
||||||
if showOpt == 1:
|
if showOpt == 1:
|
||||||
marks['url'] = row[1]
|
marks['uri'] = row[1]
|
||||||
elif showOpt == 2:
|
elif showOpt == 2:
|
||||||
marks['title'] = row[2]
|
marks['uri'] = row[1]
|
||||||
marks['tags'] = row[3][1:-1]
|
marks['tags'] = row[3][1:-1]
|
||||||
else:
|
else:
|
||||||
marks['url'] = row[1]
|
marks['uri'] = row[1]
|
||||||
marks['title'] = row[2]
|
marks['title'] = row[2]
|
||||||
marks['comment'] = row[4]
|
marks['description'] = row[4]
|
||||||
marks['tags'] = row[3][1:-1]
|
marks['tags'] = row[3][1:-1]
|
||||||
|
|
||||||
return json.dumps(marks, sort_keys=True, indent=4)
|
return json.dumps(marks, sort_keys=True, indent=4)
|
||||||
|
Loading…
Reference in New Issue
Block a user