Remove all trailing spaces.
This commit is contained in:
parent
74202db989
commit
63604a9028
10
README.md
10
README.md
@ -88,12 +88,12 @@ or download the latest [stable release](https://github.com/jarun/Buku/releases/l
|
|||||||
|
|
||||||
Install to default location:
|
Install to default location:
|
||||||
|
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
or, a custom location (PREFIX):
|
or, a custom location (PREFIX):
|
||||||
|
|
||||||
$ PREFIX=/path/to/prefix make install
|
$ PREFIX=/path/to/prefix make install
|
||||||
|
|
||||||
To remove, run:
|
To remove, run:
|
||||||
|
|
||||||
$ sudo make uninstall
|
$ sudo make uninstall
|
||||||
or, if you have installed to a custom location (PREFIX):
|
or, if you have installed to a custom location (PREFIX):
|
||||||
@ -109,7 +109,7 @@ You may need to use `sudo` with `PREFIX` depending on your permissions on destin
|
|||||||
`buku` is also available on
|
`buku` is also available on
|
||||||
- [AUR](https://aur.archlinux.org/packages/buku/) for Arch Linux;
|
- [AUR](https://aur.archlinux.org/packages/buku/) for Arch Linux;
|
||||||
- Void Linux repos.
|
- Void Linux repos.
|
||||||
|
|
||||||
$ sudo xbps-install -S buku
|
$ sudo xbps-install -S buku
|
||||||
- [Homebrew](http://braumeister.org/formula/buku) for OS X, or its Linux fork, [Linuxbrew](https://github.com/Linuxbrew/linuxbrew/blob/master/Library/Formula/buku.rb).
|
- [Homebrew](http://braumeister.org/formula/buku) for OS X, or its Linux fork, [Linuxbrew](https://github.com/Linuxbrew/linuxbrew/blob/master/Library/Formula/buku.rb).
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ Run the script:
|
|||||||
|
|
||||||
Add the same text at the beginning of multiple lines:
|
Add the same text at the beginning of multiple lines:
|
||||||
|
|
||||||
**vim**
|
**vim**
|
||||||
- Press `Ctrl-v` to select the first column of text in the lines you want to change (visual mode).
|
- Press `Ctrl-v` to select the first column of text in the lines you want to change (visual mode).
|
||||||
- Press `Shift-i` and type the text you want to insert.
|
- Press `Shift-i` and type the text you want to insert.
|
||||||
- Hit `Esc`, wait 1 second and the inserted text will appear on every line.
|
- Hit `Esc`, wait 1 second and the inserted text will appear on every line.
|
||||||
|
28
buku
28
buku
@ -192,7 +192,7 @@ def initdb():
|
|||||||
def getPageResp(url, fullurl=False):
|
def getPageResp(url, fullurl=False):
|
||||||
"""Connect to a server and fetch the requested page data.
|
"""Connect to a server and fetch the requested page data.
|
||||||
Supports gzip compression.
|
Supports gzip compression.
|
||||||
|
|
||||||
Params: URL to fetch, redirection status
|
Params: URL to fetch, redirection status
|
||||||
Returns: connection, HTTP(S) GET response
|
Returns: connection, HTTP(S) GET response
|
||||||
"""
|
"""
|
||||||
@ -245,7 +245,7 @@ def getPageResp(url, fullurl=False):
|
|||||||
|
|
||||||
def getTitleData(resp):
|
def getTitleData(resp):
|
||||||
"""Invoke HTML parser and extract title from HTTP response
|
"""Invoke HTML parser and extract title from HTTP response
|
||||||
|
|
||||||
Params: GET response
|
Params: GET response
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ def getTitleData(resp):
|
|||||||
|
|
||||||
def fetchTitle(url):
|
def fetchTitle(url):
|
||||||
"""Handle server connection and redirections
|
"""Handle server connection and redirections
|
||||||
|
|
||||||
Params: URL to fetch
|
Params: URL to fetch
|
||||||
Returns: page title or empty string, if not found
|
Returns: page title or empty string, if not found
|
||||||
"""
|
"""
|
||||||
@ -361,7 +361,7 @@ def isBookmarkAdded(cur, url):
|
|||||||
def AddUpdateEntry(conn, cur, keywords, index):
|
def AddUpdateEntry(conn, cur, keywords, index):
|
||||||
"""Add a new bookmark or update an existing record at index
|
"""Add a new bookmark or update an existing record at index
|
||||||
or insert a new record at addindex (if empty)
|
or insert a new record at addindex (if empty)
|
||||||
|
|
||||||
Params: connection, cursor, index to update
|
Params: connection, cursor, index to update
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ def dbRefresh(conn, cur):
|
|||||||
bookmark from the web and update the records. Doesn't udpate
|
bookmark from the web and update the records. Doesn't udpate
|
||||||
the record if title is empty.
|
the record if title is empty.
|
||||||
This API doesn't change DB index, URL or tags of a bookmark.
|
This API doesn't change DB index, URL or tags of a bookmark.
|
||||||
|
|
||||||
Params: connection, cursor
|
Params: connection, cursor
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ def dbRefresh(conn, cur):
|
|||||||
def searchdb(cur, keywords):
|
def searchdb(cur, keywords):
|
||||||
"""Search the database for an entries with tags or URL
|
"""Search the database for an entries with tags or URL
|
||||||
or title info matching keywords and list those.
|
or title info matching keywords and list those.
|
||||||
|
|
||||||
Params: cursor, keywords to search
|
Params: cursor, keywords to search
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -539,7 +539,7 @@ def searchdb(cur, keywords):
|
|||||||
def compactDB(conn, cur, index):
|
def compactDB(conn, cur, index):
|
||||||
"""When an entry at index is deleted, move the last
|
"""When an entry at index is deleted, move the last
|
||||||
entry in DB to index, if index is lesser.
|
entry in DB to index, if index is lesser.
|
||||||
|
|
||||||
Params: connection, cursor, index of deleted entry
|
Params: connection, cursor, index of deleted entry
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -560,7 +560,7 @@ def compactDB(conn, cur, index):
|
|||||||
|
|
||||||
def cleardb(conn, cur, index):
|
def cleardb(conn, cur, index):
|
||||||
"""Delete a single record or remove the table if index is None
|
"""Delete a single record or remove the table if index is None
|
||||||
|
|
||||||
Params: connection, cursor, index to delete
|
Params: connection, cursor, index to delete
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -590,7 +590,7 @@ def cleardb(conn, cur, index):
|
|||||||
def printdb(cur, index, empty=False):
|
def printdb(cur, index, empty=False):
|
||||||
"""Print bookmark details at index or all bookmarks if index is None
|
"""Print bookmark details at index or all bookmarks if index is None
|
||||||
Print only bookmarks with empty title or tags if empty is True
|
Print only bookmarks with empty title or tags if empty is True
|
||||||
|
|
||||||
Params: cursor, index to print, flag to show only bookmarks with no title or tags
|
Params: cursor, index to print, flag to show only bookmarks with no title or tags
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ def printdb(cur, index, empty=False):
|
|||||||
|
|
||||||
def showUniqueTags(cur):
|
def showUniqueTags(cur):
|
||||||
"""Print all unique tags ordered alphabetically
|
"""Print all unique tags ordered alphabetically
|
||||||
|
|
||||||
Params: cursor
|
Params: cursor
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ def showUniqueTags(cur):
|
|||||||
def replaceTags(conn, cur, orig, new):
|
def replaceTags(conn, cur, orig, new):
|
||||||
"""Replace orig tags with new tags in DB for all records.
|
"""Replace orig tags with new tags in DB for all records.
|
||||||
Remove orig tag is new tag is empty.
|
Remove orig tag is new tag is empty.
|
||||||
|
|
||||||
Params: connection, cursor, original and new tags
|
Params: connection, cursor, original and new tags
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -692,7 +692,7 @@ def replaceTags(conn, cur, orig, new):
|
|||||||
|
|
||||||
def fetchopen(index):
|
def fetchopen(index):
|
||||||
"""Fetch URL at index and open in browser
|
"""Fetch URL at index and open in browser
|
||||||
|
|
||||||
Params: index
|
Params: index
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -709,7 +709,7 @@ def fetchopen(index):
|
|||||||
|
|
||||||
def is_int(string):
|
def is_int(string):
|
||||||
"""Check if a string is a digit
|
"""Check if a string is a digit
|
||||||
|
|
||||||
Params: string
|
Params: string
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ def encrypt_file():
|
|||||||
dbhash = get_filehash(dbpath)
|
dbhash = get_filehash(dbpath)
|
||||||
|
|
||||||
# Generate randon 256-bit salt and key
|
# Generate randon 256-bit salt and key
|
||||||
salt = Random.get_random_bytes(SALT_SIZE)
|
salt = Random.get_random_bytes(SALT_SIZE)
|
||||||
key = (password + salt.decode('utf-8', "replace")).encode('utf-8')
|
key = (password + salt.decode('utf-8', "replace")).encode('utf-8')
|
||||||
for i in range(iterations):
|
for i in range(iterations):
|
||||||
key = hashlib.sha256(key).digest()
|
key = hashlib.sha256(key).digest()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user