mirror of
https://github.com/tildeclub/ttrv.git
synced 2026-07-25 00:49:23 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e1f3766512 | |||
| 3a99a87755 | |||
| d1d1fc89cf | |||
| 726931c7bf | |||
| fec5a0cdc7 |
14
README.md
14
README.md
@@ -6,7 +6,7 @@ A text-based interface (TUI) to view and interact with Reddit from your terminal
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/title_image.png"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/title_image.png"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -26,7 +26,7 @@ A text-based interface (TUI) to view and interact with Reddit from your terminal
|
|||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/demo.gif"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/demo.gif"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -102,7 +102,7 @@ $ ttrv --copy-config
|
|||||||
You can use [mailcap](https://en.wikipedia.org/wiki/Media_type#Mailcap) to configure how TTRV will open different types of links.
|
You can use [mailcap](https://en.wikipedia.org/wiki/Media_type#Mailcap) to configure how TTRV will open different types of links.
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/mailcap.gif"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/mailcap.gif"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
A mailcap file allows you to associate different MIME media types, like ``image/jpeg`` or ``video/mp4``, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.
|
A mailcap file allows you to associate different MIME media types, like ``image/jpeg`` or ``video/mp4``, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.
|
||||||
@@ -150,21 +150,21 @@ Themes can be used to customize the look and feel of TTRV
|
|||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Solarized Dark</strong></p>
|
<p><strong>Solarized Dark</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_solarized_dark.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_solarized_dark.png"></img>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Solarized Light</strong></p>
|
<p><strong>Solarized Light</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_solarized_light.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_solarized_light.png"></img>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Papercolor</strong></p>
|
<p><strong>Papercolor</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_papercolor.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_papercolor.png"></img>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Molokai</strong></p>
|
<p><strong>Molokai</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_molokai.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_molokai.png"></img>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
34
setup.py
34
setup.py
@@ -1,8 +1,6 @@
|
|||||||
import sys
|
|
||||||
import codecs
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
from version import __version__ as version
|
from ttrv.__version__ import __version__ as version
|
||||||
|
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
@@ -15,7 +13,7 @@ install_requires = [
|
|||||||
|
|
||||||
tests_require = [
|
tests_require = [
|
||||||
'coveralls',
|
'coveralls',
|
||||||
'pytest>=3.1.0', # Pinned for the ``pytest.param`` method
|
'pytest>=8.3.0',
|
||||||
'coverage',
|
'coverage',
|
||||||
'mock',
|
'mock',
|
||||||
'pylint',
|
'pylint',
|
||||||
@@ -26,20 +24,8 @@ extras_require = {
|
|||||||
'test': tests_require
|
'test': tests_require
|
||||||
}
|
}
|
||||||
|
|
||||||
# https://hynek.me/articles/conditional-python-dependencies/
|
|
||||||
if int(setuptools.__version__.split(".", 1)[0]) < 18:
|
|
||||||
assert "bdist_wheel" not in sys.argv
|
|
||||||
if sys.version_info[0:2] < (3, 6):
|
|
||||||
install_requires.append("mailcap-fix")
|
|
||||||
else:
|
|
||||||
# Building the bdist_wheel with conditional environment dependencies
|
|
||||||
# requires setuptools version > 18. For older setuptools versions this
|
|
||||||
# will raise an error.
|
|
||||||
extras_require.update({":python_version<'3.6'": ["mailcap-fix"]})
|
|
||||||
|
|
||||||
|
|
||||||
def long_description():
|
def long_description():
|
||||||
with codecs.open('README.md', encoding='utf8') as f:
|
with open('README.md', encoding='utf8') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
@@ -65,8 +51,8 @@ setuptools.setup(
|
|||||||
},
|
},
|
||||||
data_files=[("share/man/man1", ["ttrv.1"])],
|
data_files=[("share/man/man1", ["ttrv.1"])],
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
tests_require=tests_require,
|
|
||||||
extras_require=extras_require,
|
extras_require=extras_require,
|
||||||
|
python_requires='>=3.9',
|
||||||
entry_points={'console_scripts': ['ttrv=ttrv.__main__:main']},
|
entry_points={'console_scripts': ['ttrv=ttrv.__main__:main']},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Intended Audience :: End Users/Desktop',
|
'Intended Audience :: End Users/Desktop',
|
||||||
@@ -74,11 +60,13 @@ setuptools.setup(
|
|||||||
'Operating System :: MacOS :: MacOS X',
|
'Operating System :: MacOS :: MacOS X',
|
||||||
'Operating System :: POSIX',
|
'Operating System :: POSIX',
|
||||||
'Natural Language :: English',
|
'Natural Language :: English',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 3',
|
||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.9',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.10',
|
||||||
'Programming Language :: Python :: 3.6',
|
'Programming Language :: Python :: 3.11',
|
||||||
'Programming Language :: Python :: 3.7',
|
'Programming Language :: Python :: 3.12',
|
||||||
|
'Programming Language :: Python :: 3.13',
|
||||||
|
'Programming Language :: Python :: 3.14',
|
||||||
'Topic :: Terminals',
|
'Topic :: Terminals',
|
||||||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Message Boards',
|
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Message Boards',
|
||||||
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary',
|
'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary',
|
||||||
|
|||||||
2
ttrv.1
2
ttrv.1
@@ -1,4 +1,4 @@
|
|||||||
.TH "TTRV" "1" "June 03, 2019" "Version 1.27.0" "Usage and Commands"
|
.TH "TTRV" "1" "June 03, 2019" "Version 1.27.4" "Usage and Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
TTRV - Tilde Terminal Reddit Viewer
|
TTRV - Tilde Terminal Reddit Viewer
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: ttrv
|
Name: ttrv
|
||||||
Version: 1.27.3
|
Version: 1.27.4
|
||||||
Summary: Tilde Terminal Reddit Viewer
|
Summary: Tilde Terminal Reddit Viewer
|
||||||
Home-page: https://github.com/tildeclub/ttrv
|
Home-page: https://github.com/tildeclub/ttrv
|
||||||
Author: deepend (forked from RTV)
|
Author: deepend (forked from RTV)
|
||||||
@@ -34,7 +34,7 @@ A text-based interface (TUI) to view and interact with Reddit from your terminal
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/title_image.png"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/title_image.png"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -54,7 +54,7 @@ A text-based interface (TUI) to view and interact with Reddit from your terminal
|
|||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/demo.gif"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/demo.gif"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@@ -130,7 +130,7 @@ $ ttrv --copy-config
|
|||||||
You can use [mailcap](https://en.wikipedia.org/wiki/Media_type#Mailcap) to configure how TTRV will open different types of links.
|
You can use [mailcap](https://en.wikipedia.org/wiki/Media_type#Mailcap) to configure how TTRV will open different types of links.
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/master/resources/mailcap.gif"/>
|
<img alt="title image" src="https://github.com/tildeclub/ttrv/raw/main/resources/mailcap.gif"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
A mailcap file allows you to associate different MIME media types, like ``image/jpeg`` or ``video/mp4``, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.
|
A mailcap file allows you to associate different MIME media types, like ``image/jpeg`` or ``video/mp4``, with shell commands. This feature is disabled by default because it takes a few extra steps to configure. To get started, copy the default mailcap template to your home directory.
|
||||||
@@ -178,21 +178,21 @@ Themes can be used to customize the look and feel of TTRV
|
|||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Solarized Dark</strong></p>
|
<p><strong>Solarized Dark</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_solarized_dark.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_solarized_dark.png"></img>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Solarized Light</strong></p>
|
<p><strong>Solarized Light</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_solarized_light.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_solarized_light.png"></img>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Papercolor</strong></p>
|
<p><strong>Papercolor</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_papercolor.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_papercolor.png"></img>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<p><strong>Molokai</strong></p>
|
<p><strong>Molokai</strong></p>
|
||||||
<img src="https://github.com/tildeclub/ttrv/raw/master/resources/theme_molokai.png"></img>
|
<img src="https://github.com/tildeclub/ttrv/raw/main/resources/theme_molokai.png"></img>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '1.27.3'
|
__version__ = '1.27.5'
|
||||||
|
|||||||
@@ -196,8 +196,11 @@ class Config(object):
|
|||||||
|
|
||||||
def save_refresh_token(self):
|
def save_refresh_token(self):
|
||||||
self._ensure_filepath(self.token_file)
|
self._ensure_filepath(self.token_file)
|
||||||
with open(self.token_file, 'w+') as fp:
|
flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
|
||||||
|
fd = os.open(self.token_file, flags, 0o600)
|
||||||
|
with os.fdopen(fd, 'w') as fp:
|
||||||
fp.write(self.refresh_token)
|
fp.write(self.refresh_token)
|
||||||
|
os.chmod(self.token_file, 0o600)
|
||||||
|
|
||||||
def delete_refresh_token(self):
|
def delete_refresh_token(self):
|
||||||
if os.path.exists(self.token_file):
|
if os.path.exists(self.token_file):
|
||||||
@@ -250,7 +253,7 @@ class Config(object):
|
|||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
with codecs.open(filename, encoding='utf-8') as fp:
|
with codecs.open(filename, encoding='utf-8') as fp:
|
||||||
config.readfp(fp)
|
config.read_file(fp)
|
||||||
|
|
||||||
return cls._parse_ttrv_file(config)
|
return cls._parse_ttrv_file(config)
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ from warnings import filterwarnings, warn
|
|||||||
|
|
||||||
# Enable deprecation warnings from this module
|
# Enable deprecation warnings from this module
|
||||||
filterwarnings('default', category=DeprecationWarning,
|
filterwarnings('default', category=DeprecationWarning,
|
||||||
module='^praw\.decorators$')
|
module=r'^praw\.decorators$')
|
||||||
|
|
||||||
|
|
||||||
def alias_function(function, class_name):
|
def alias_function(function, class_name):
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ class Theme(object):
|
|||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.optionxform = six.text_type # Preserve case
|
config.optionxform = six.text_type # Preserve case
|
||||||
with codecs.open(filename, encoding='utf-8') as fp:
|
with codecs.open(filename, encoding='utf-8') as fp:
|
||||||
config.readfp(fp)
|
config.read_file(fp)
|
||||||
except configparser.ParsingError as e:
|
except configparser.ParsingError as e:
|
||||||
raise ConfigError(e.message)
|
raise ConfigError(e.message)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user