Tilde终端Reddit查看器

ttrv的Python项目详细描述


波浪形终端Reddit Viewer(TTRV)

从原始源代码/开发分支到:RTV

一个基于文本的界面(TUI),用于从终端查看Reddit并与之交互。

title image

目录

演示

title image

安装

PyPI包

TTRV可在PyPI上使用,并可与pip一起安装:

$ pip install ttrv

来源

^{pr2}$

Windows

TTRV在Windows上不受支持,但您可以启用Windows subsystem for Linux,从Microsoft Store下载首选的Linux发行版并从那里访问它。在

要打开边缘上的链接,请将下面的行粘贴到{HOME}/.bashrc

export BROWSER='/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'

使用

要运行程序,请键入:

$ ttrv --help

控制

使用箭头键或Vim样式移动光标:

  • 滚动提交内容
  • 以查看所选提交内容和返回
  • 按空格键展开/折叠注释
  • u登录(这需要OAuth的web浏览器)
  • 打开帮助屏幕

/打开导航提示,您可以在其中键入以下内容:

  • /front
  • /r/commandprompt+linuxmasterrace
  • /r/programming/controversial
  • /u/me
  • /u/multi-mod/m/art
  • /domain/github.com

有关命令的完整列表,请参见CONTROLS。在

设置

配置文件

配置文件存储在{HOME}/.config/ttrv/目录中。在

查看ttrv.cfg可配置选项的完整列表。您可以通过运行以下命令将此文件克隆到主目录中:

$ ttrv --copy-config

查看媒体链接

您可以使用mailcap来配置TTRV将如何打开不同类型的链接。在

title image

mailcap文件允许您将不同的MIME媒体类型(如image/jpeg或{})与shell命令相关联。此功能在默认情况下被禁用,因为它需要一些额外的步骤来配置。要开始,请将默认的mailcap模板复制到主目录。在

$ ttrv --copy-mailcap

此模板包含常见MIME类型的示例,这些MIME类型可用于流行的reddit网站,如imguryoutubegfycat。打开mailcap模板并按照其中列出的instructions进行操作。在

一旦设置了mailcap文件,就可以使用ttrv --enable-media标志启动ttrv(或在^{str 1}中设置它)来启用它$ttrv.cfg公司)

环境变量

TTRV与之交互的默认程序可以通过环境变量进行配置:

$TTRV_EDITORA program used to compose text submissions and comments, e.g. vim, emacs, gedit
If not specified, will fallback to $VISUAL and $EDITOR in that order.
$TTRV_BROWSERA program used to open links to external websites, e.g. firefox, google-chrome, w3m, lynx
If not specified, will fallback to $BROWSER, or your system's default browser.
$TTRV_URLVIEWERA tool used to extract hyperlinks from blocks of text, e.g. urlview, urlscan
If not specified, will fallback to urlview if it is installed.

剪贴板

TTRV支持将提交链接复制到操作系统剪贴板。在macOS上,这是现成的支持。 在Linux系统上,您需要安装xsel或{a17}。在

主题

主题可用于定制TTRV的外观

^{tb2}$

您可以使用--list-themes命令列出所有已安装的主题,并使用--theme选择一个主题。您可以将您的选择永久保存在ttrv.cfg文件中。您也可以使用TTRV内部的F2和F3键循环浏览所有可用的主题。在

有关编写和安装您自己的主题的说明,请参见THEMES.md。在

常见问题解答

<详细信息>为什么我在安装/启动ttrv时出错?

If your distro ships with an older version of python 2.7 or python-requests, you may experience SSL errors or other package incompatibilities. The easiest way to fix this is to install ttrv using python 3. If you don't already have pip3, see http://stackoverflow.com/a/6587528 for setup instructions. Then do

$ sudo pip uninstall ttrv
$ sudo pip3 install -U ttrv
<详细信息>为什么我会看到像M-b~@M-“^@@这样的乱码文本?

This type of text usually shows up when python is unable to render unicode properly.

  1. Try starting TTRV in ascii-only mode with ttrv --ascii
  2. Make sure that the terminal/font that you're using supports unicode
  3. Try setting the LOCALE to utf-8
  4. Your python may have been built against the wrong curses library, see here and here for more information
<详细信息>如何直接从存储库运行代码?

This project is structured to be run as a python module. This means that you need to launch it using python's -m flag. See the example below, which assumes that you have cloned the repository into the directory ~/ttrv_project.

$ cd ~/ttrv_project
$ python3 -m ttrv

贡献

所有馈线欢迎回复和建议,只需发布一个问题!在

在编写任何代码之前,请阅读Contributor Guidelines。在

许可证

此项目是在MIT许可证下分发的。在

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

推荐PyPI第三方库


热门话题
Java类之间并发性不一致的HashMap   插件如何在JavaSwing中使用UIManager和Classloader从外部jar安装外观?   java JasperReports:找不到子报表   在项目中找不到java生成的Javadoc文件   java BigDecimal。multiply()和divide()方法返回十六进制数。为什么?   java统计出现次数并从字符串中删除重复项   调用运算符时发生java NullPointerException   Spring和Hibernate之间的java配置错误   JavaZK将用户重定向回上一页   Javasocket为传出连接指定特定的网络接口   如果拖动到某个区域外,java Make按钮操作将被取消   如何在Eclipse for selenium 3.141.59中添加Java文档链接   java从匹配条件的数组中获取所有索引   docker未连接到RemoteWebDriver的java Gitlab ci selenium测试   java重写run方法   utf 8如何使用java解码UTF8编码的字符串?   java如何从eclipse调试部署在tomcat上的web应用程序?   将字母字符与前面没有百分号的Java正则表达式匹配