Added some color to output.
Signed-off-by: Arun Prakash Jana <engineerarun@gmail.com>
This commit is contained in:
parent
59d3d2aec6
commit
775ec7fdd3
6
markit
6
markit
@ -91,13 +91,13 @@ def searchdb(cur, keywords):
|
||||
OR URL LIKE ('%' || ? || '%')", (searchtag, searchkey, searchkey)):
|
||||
results.append(row[1])
|
||||
count += 1
|
||||
print("%d. %s" % (count, row[1]))
|
||||
print("\x1B[1m\x1B[93m%d. \x1B[0m\x1B[92m%s\x1B[0m" % (count, row[1]))
|
||||
|
||||
if count == 0:
|
||||
return
|
||||
|
||||
while True:
|
||||
nav = input("Enter index number to open: ")
|
||||
nav = input("Index number to open: ")
|
||||
if is_int(nav):
|
||||
index = int(nav) - 1
|
||||
if index < 0:
|
||||
@ -148,7 +148,7 @@ def cleardb(conn, cur):
|
||||
|
||||
def printtable(cur):
|
||||
for row in cur.execute('SELECT * FROM bookmarks'):
|
||||
print("%s. %s\n\t[TAGS] %s\n\t[META] %s" % (row[0], row[1], row[2][1:-1], row[3]))
|
||||
print("\x1B[1m\x1B[93m%s. \x1B[0m\x1B[92m%s\x1B[0m\n\t[TAGS] %s\n\t[META] %s" % (row[0], row[1], row[2][1:-1], row[3]))
|
||||
|
||||
def is_int(string):
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user