Store tags in lower case.
This commit is contained in:
parent
e56c04a315
commit
63bce1004d
@ -220,7 +220,7 @@ Shell completion scripts for Bash, Fish and Zsh can be found in respective subdi
|
||||
- URLs are unique in DB. The same URL cannot be added twice.
|
||||
- Bookmarks with immutable titles are listed with bold `(L)` after the URL.
|
||||
- **Tags**:
|
||||
- Comma (`,`) is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags can be replaced.
|
||||
- Comma (`,`) is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags are stored in lower case and can be replaced, appended or deleted.
|
||||
- **Update** operation:
|
||||
- If --title, --tag or --comment is passed without argument, clear the corresponding field from DB.
|
||||
- If --url is passed (and --title is omitted), update the title from web using the URL.
|
||||
|
2
buku.1
2
buku.1
@ -34,7 +34,7 @@ URLs are unique in DB. The same URL cannot be added twice.
|
||||
Bookmarks with immutable titles are listed with bold '(L)' after the URL.
|
||||
.PP
|
||||
\fITags\fR:
|
||||
- Comma (',') is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags can be replaced.
|
||||
- Comma (',') is the tag delimiter in DB. A tag cannot have comma(s) in it. Tags are filtered (for unique tags) and sorted. Tags are stored in lower case and can be replaced, appended or deleted.
|
||||
.PP
|
||||
\fIUpdate\fR operation:
|
||||
- If --title, --tag or --comment is passed without argument, clear the corresponding field from DB.
|
||||
|
7
buku.py
7
buku.py
@ -1624,11 +1624,12 @@ def parse_tags(keywords=None):
|
||||
|
||||
orig_tags += tags.strip(DELIM).split(DELIM)
|
||||
for tag in orig_tags:
|
||||
if tag not in unique_tags:
|
||||
unique_tags += (tag, ) # Select unique tags
|
||||
if tag.lower() not in unique_tags:
|
||||
# Add unique tags in lowercase
|
||||
unique_tags += (tag.lower(), )
|
||||
|
||||
# Sort the tags
|
||||
sorted_tags = sorted(unique_tags, key=str.lower)
|
||||
sorted_tags = sorted(unique_tags)
|
||||
|
||||
# Wrap with delimiter
|
||||
return '%s%s%s' % (DELIM, DELIM.join(sorted_tags), DELIM)
|
||||
|
Loading…
x
Reference in New Issue
Block a user