简单的命令行书签和/或标记实用程序。

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安装请求”

许可证

此程序受GPLv3许可证约束。

你应该收到GNU通用公共许可证的副本 还有这个节目。如果没有,请参见<;http://www.gnu.org/licenses/>;。

联系人

Main developper: Cédric Picard
Email:           cedric.picard@efrei.net
Twitter:         @Cym13
GPG:             383A 76B9 D68D 2BD6 9D2B  4716 E3B9 F4FE 5CED 42CB

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在TextView中对齐部分文本   带有iText和eTPKCS11的java PKCS#11签名。dll&SunPKCS11提供程序   java Intellij Idea找不到jar   java Chrome/Firefox和Jetty HTTPS   java我无法打包找不到的JavaFX应用程序模块   多线程Java:排序从异步任务检索的结果   java客户端/服务器socket不能与外部连接一起工作   java如何在单击“下一步”按钮时获取其他详细信息?   java组织。springframework。网状物客户RestTemplate应声明为@Bean,而plain@Autowired抛出错误   java如何绘制javax。摆动将ImageIcon转换为JavaFX。fxml呈现用户界面?   使用for循环的Java跟踪   java如何编码字符串以显示彩色文本(基于字符串中的前缀)   Java保存/打开文件对象   基于java复选框的搜索:使用尽可能多的“”动态生成准备好的语句作为选中复选框的计数   java为什么crawler4j随机挂起?