简单的命令行书签和/或标记实用程序。
bm的Python项目详细描述
说明
简单的命令行书签和/或标记实用程序。
为了帮助使用它标记文件和目录以及url,它 识别给定的URL是否是现有文件的URL。如果是,绝对的 路径被替换为通过管道输出和转义来帮助编写脚本 模棱两可。使用“–no path subs”选项可以停止此行为。
查看此程序的一种方法是将其视为 将一组字符串(标记)关联到另一个字符串(url)的bash。 请随意寻找其他方法使用这个程序!
使用msgpack是因为它具有高度的可移植性、语言不可知性和高度的 效率高
这个脚本是用python3编写的
这个版本是稳定的。
文件
Simple command line browser independant bookmark utility. Usage: bm [options] [-r] URL TAG... bm [options] -d URL bm [options] -l [TAG]... bm [options] -L TAG... bm [options] URL bm [options] -i SOURCE... bm [options] -t Arguments: URL The url to bookmark If alone, print the tags associated with URL If the url corresponds to an existing file, the absolute path is substituted to URL If URL is '-', then the program looks for a list of URL comming from the standard input. TAG The tags to use with the url. SOURCE When uniting, the paths to the source files. Options: -h, --help Print this help and exit -r, --remove Remove TAG from URL -d, --delete Delete an url from the database -l, --list-every List the urls with every of TAG If no tag is given, list all urls -L, --list-any List the urls with any of TAG -f, --file FILE Use FILE as the database, can be an url Default is ~/.bookmarks -t, --tags List every tag present in the database with how many times it is used. Output is sorted from the least to the most used -i, --import Import bookmarks from sources into the database. -c, --clean Clean database on loading, removing duplicates -n, --no-path-subs Disable file path substitution -v, --verbose Displays the list of tags of each url when listing -w, --web Open the results in a web browser --version Print current version number
示例
$ bm "http://duckduckgo.com" bad search engine $ bm "http://google.com" bad search engine $ bm "http://python.org" python official $ bm -l search engine http://duckduckgo.com http://google.com $ bm -r "http://duckduckgo.com" bad $ bm "http://duckduckgo.com" cool $ bm "http://duckduckgo.com" cool engine search $ bm -l search engine http://duckduckgo.com http://google.com $ bm -l bad search engine http://google.com $ bm -L bad search engine http://duckduckgo.com http://google.com $ bm -l http://duckduckgo.com http://google.com http://python.org $ bm -t cool engine search bad python official $ cat urls | bm - atag
安装
最简单的方法是使用:
pip install bm
否则,您可以在该目录下执行此操作
python3 setup install
这也应该安装依赖项。
archlinux也提供了一个aur包:
yaourt -S bm
你呢,怎么用?
与许多cli工具一样,bm是以unix方式设计的:考虑到可组合性。 这就是为什么它的输出主要是纯文本,每行一个条目 分隔符。
我使用的urxvt和urxvt perls允许从 终点站。
我的主浏览器是qutebrowser,但我有bm链接到dwb或firefox 以前。为此,我在配置中保留两个键绑定 外部命令:
set-cmd-text -s :spawn -- bm '{url}' b set-cmd-text -s :spawn -- bm -w -v -l B
这样,在一个页面上,我按b键为当前url添加书签,然后键入 浏览器提示上的标记。b用于搜索,请注意它如何使用html 使用-w显示以在新选项卡中打开结果。
对于同步,我在一个脚本上转发,该脚本是 我的计算机然后进行本地文件导入。
当我在一些非常大的项目中工作时,我也使用bm为路径和 这样我就可以快速找到一组给定的文件。为此我有一个 别名,以便不将此工作与其他URL混合
alias fbm="bm -f ~/.path_bm"
当bm自动扩展相对路径时,它非常适合这种用法。
这些只是一些个人的例子,我希望你能找到你的!
在–clean选项中
版本<;1.6.0上有一个小错误,如果您正在创建一个新的 具有两倍相同标记的条目它不会检测到doublon并存储 标记两次。
我决定不冒破坏现有数据库的风险,所以我添加了-WORD。 清除有错误的数据库并删除双标记的选项。而且,这个错误是 修正了,所以你不必运行多次。依赖关系
docopthttps://github.com/docopt/docopt或“pip install docopt”
msgpackhttp://msgpack.org/或“pip install msgpack python”
请求https://github.com/kennethreitz/requests或“pip安装请求”
联系人
Main developper: Cédric Picard Email: cedric.picard@efrei.net Twitter: @Cym13 GPG: 383A 76B9 D68D 2BD6 9D2B 4716 E3B9 F4FE 5CED 42CB