Skip to content

Commit

Permalink
Hotfix - implement "Support custom colours" from (jarun#174)
Browse files Browse the repository at this point in the history
# sorted import in alphabetical order
# adjusted var name's
# add color table to man page
  • Loading branch information
shv-q3 committed Aug 18, 2017
1 parent 2eb1f06 commit f4d56ea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions buku.1
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,16 @@ can be integrated in a GUI environment with simple tweaks. Refer to:
.br
.I https://github.com/jarun/Buku#gui-integration
.SH COLORS
\fBbuku\fR allows you to customize the color scheme via a four-letter string, reminiscent of BSD \fBLSCOLORS\fR. The six letters represent the colors of
\fBbuku\fR allows you to customize the color scheme via a four-letter string, reminiscent of BSD \fBLSCOLORS\fR. The four letters represent the colors of
.IP - 2
bookmark id and title
bookmark's id and title
.PD 0 \" Change paragraph spacing to 0 in the list
.IP - 2
URLs
bookmark's url
.IP - 2
bookmark description
.IP - 2
bookmark tag
bookmark's tag
.PD 1 \" Restore paragraph spacing
.TP
respectively. The four-letter string is passed in either as the argument to the \fB--colors\fR option.
Expand Down
24 changes: 12 additions & 12 deletions buku.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# along with Buku. If not, see <http://www.gnu.org/licenses/>.

import argparse
import collections
import html.parser as HTMLParser
import json
import logging
Expand All @@ -36,7 +37,6 @@
import urllib3
from urllib3.util import parse_url, make_headers
import webbrowser
import collections

__version__ = '3.2'
__author__ = 'Arun Prakash Jana <engineerarun@gmail.com>'
Expand Down Expand Up @@ -2673,30 +2673,30 @@ def print_single_rec(row, idx=0): # NOQA

# Start with index and title
if idx != 0:
idandtitleresult = ID_str % (idx, row[2] if row[2] else 'Untitled', row[0])
id_title_res = ID_str % (idx, row[2] if row[2] else 'Untitled', row[0])
else:
idandtitleresult = ID_DB_str % (row[0], row[2] if row[2] else 'Untitled')
id_title_res = ID_DB_str % (row[0], row[2] if row[2] else 'Untitled')
# Indicate if record is immutable
if row[5] & 1:
idandtitleresult = MUTE_str % (idandtitleresult)
id_title_res = MUTE_str % (id_title_res)
else:
idandtitleresult += '\n'
id_title_res += '\n'

# Append URL
urlresult = ''
urlresult = URL_str % (urlresult, row[1])
url_res = ''
url_res = URL_str % (url_res, row[1])

# Append description
descresult = ''
desc_res = ''
if row[4]:
descresult = DESC_str % (descresult, row[4])
desc_res = DESC_str % (desc_res, row[4])

# Append tags IF not default (delimiter)
tagresult = ''
tag_res = ''
if row[3] != DELIM:
tagresult = TAG_str % (tagresult, row[3][1:-1])
tag_res = TAG_str % (tag_res, row[3][1:-1])

print(idandtitleresult + urlresult + descresult + tagresult)
print(id_title_res + url_res + desc_res + tag_res)

def format_json(resultset, single_record=False, field_filter=0):
'''Return results in Json format
Expand Down

0 comments on commit f4d56ea

Please sign in to comment.