Commit Graph

41 Commits

Author SHA1 Message Date
John Helmert III
4e00011c78 Create format_list once per SubredditPage 2020-04-24 21:17:08 -05:00
John Helmert III
790f505d2f Fix mpv arguments in mailcap template 2020-03-18 09:59:45 -05:00
capnhawkbill
8ba5b09105 Fixed mailcap 2020-03-16 17:08:44 -05:00
armandg
d5a869348f Added a Markdown cheat sheet in instructions when commenting/posting/editing 2020-02-05 11:54:27 -06:00
John Helmert III
cab6227070 Minor formatting fix in Terminal._load_mailcaps() 2019-11-14 17:05:08 -06:00
OKelt
4e50bb709f Terminal._load_mailcaps defaults to simple mailcap.getcaps() if XDG_CONFIG_HOME/tuir/mailcap does not exist 2019-11-12 23:11:18 -08:00
OKelt
cf4f40ff04 Terminal._load_mailcaps uses os.environ instead of os.putenv 2019-11-12 23:11:18 -08:00
OKelt
4ecaf612f6 created internal terminal funciton load_mailcaps to load application-specific mailcap file 2019-11-12 23:11:18 -08:00
OKelt
8fedb42ebd created Config static variables TUIR_CONFIG_HOME, TUIR_DATA_HOME; refactored paths for other static variables to use these values
set Config.MAILCAP to TUIR_CONFIG_HOME/mailcap (TUIR_CONFIG_HOME = $XDG_CONFIG_HOME/tuir)
2019-11-12 23:11:18 -08:00
geeseven
6c2c6fc900 fix project URL in [?]Help 2019-09-24 19:46:48 +00:00
John Helmert
b6dc9da257 Forward-port changes made to 1.28.x from 1.28-maint 2019-09-15 10:24:57 -05:00
John Helmert
0238501e2b Add support for parsing [rtv] config sections, bug #13 2019-09-02 16:55:15 -05:00
John Helmert
c174a19618 Update config template to reflect changes
Added more detailed information related to the subreddit_format option
to reflect changes in SubredditPage, and mark the subreddit_format
option as an experimental feature.
2019-08-26 14:20:31 -05:00
John Helmert
446f50be28 Simplify format string handling
Instead of using a format that is stored in a three-wide tuple in each
SubredditPage, the displaying is done at display-time. Functionality
related to creating the format has been removed. Additionally, this
simplification makes it possible for correctly spacing the %F format
specifier. Previously, it couldn't easily look ahead to check if a space
was necessary; now, the spacing should be always be correct for any
combination of flair-like information and consecutive spaces will not be
printed to ensure the format isn't made to look strange if a piece of
data is missing.

Tests have also been updated to reflect changes in the SubredditPage
class. The SubredditPage._create_format test has been removed, and much
of its functionality is now tested in the test for
SubredditPage._draw_item_format.

Related to #3
2019-08-19 19:00:54 -05:00
John Helmert
17c8e9e08e Fix typo in clipboard.py causing copy bug
Fixes #5
2019-08-03 18:05:36 -05:00
John Helmert
3480faae74 Sanitize datetime strings for Python version compatability 2019-08-02 10:41:24 -05:00
John Helmert
26ab4c35a2 Implement using absolute creation and edit times
As suggested in #3
2019-08-01 22:25:32 -05:00
John Helmert
f25a29100e Add exact timestamp to Reddit submission data dictionary
This will enable easy implementation of the exact timestamp display as
requested in #3
2019-08-01 22:24:46 -05:00
John Helmert
8df2df93f6 Simplify score and comment count data
This commit changes the functionality of the Content class (and its
subclasses) by removing the text from the comments and score fields of
Reddit data dictionaries created by Content.strip*.  data['comments'] is
now an integer, but data['score'] remains a string to preserve using '-'
when the score is hidden.

It is now the responsibility of wherever this data is used to provide
the extra text that these variables used to include, and modifications
have been made to the Submission and Subreddit classes to preserve the
previous way the data was displayed.

Tests modified to expect these changes.
2019-07-29 19:10:26 -05:00
John Helmert
9e43d7ed65 Explicitly print format data as strings
SubredditPage._draw_item_format now explicitly converts everything it
prints to a string. This fixes crashing on Redditor pages when the
Redditor object was split() before converting it to a string. Modified
variable names to reflect different types.
2019-07-29 18:34:18 -05:00
John Helmert
88a75492a4 Repair failing test and fix %U bug
Fix SubredditPage._url_str parsing the wrong URL for 'external' URL
types. Make urlparse import agnostic between python2 and 3.
2019-07-25 21:23:17 -05:00
John Helmert
878a510185 Implement %u format specifier
New test function for the new SubredditPage._url_str() function added to
test_subreddit.py. Being able to see the information this specifier adds
makes it trivial to tell if a post is a Reddit crosspost from a
SubredditPage (more trivial than manually parsing a full URL from %U,
anyway).
2019-07-25 18:21:04 -05:00
John Helmert
e3853f9085 Simplify detecting and handling separators in format 2019-07-24 11:27:59 -05:00
John Helmert
59ac141528 Explicitly make post index a string in format 2019-07-22 17:54:39 -05:00
John Helmert
a5c8ecc88b Fix space-checking strings in SubredditPage._draw_item_format 2019-07-22 14:13:47 -05:00
John Helmert
0255c217eb Repair and test logic to avoid printing None strings 2019-07-21 15:47:18 -05:00
John Helmert
c146b13aa5 Implement user formatting of SubredditPages
Users can now specify a format string in their config file that
determines the internal layout of subwindows of a SubredditPage. The
config string is passed to SubredditPage._create_format(), and internal
details can be found in its docstring. SubredditPage._draw_item_format()
then draws the format produced by SubredditPage._create_format().

With this addition, simplication could be made with the compact format.
Instead of its own dedicated draw function, it now uses
_draw_item_format() with a format that produces the same result as
_draw_item_compact(). With this, _draw_item_compact() will be removed
as its functionality has been replaced.

If the user specifies a look_and_feel and a subreddit_format in their
config, the latter overrides the formatting of the former.

Relevant to #3
2019-07-05 16:18:21 -05:00
John Helmert
df1e439c57 Fix improper format on user pages with compact mode 2019-07-02 17:58:19 -05:00
John Helmert
491e652470 Encapsulate config constants in Config class 2019-07-01 19:10:18 -05:00
John Helmert
17a17f12d5 Fix and split clipboard tests into *nix and Darwin 2019-06-29 21:33:04 -05:00
John Helmert
6508131212 Implement compact look and feel.
This comes with the addition of adding a reference to the config in
SubredditPage objects, which breaks a lot of tests. Thoroughly discussed
in #3.
2019-06-28 17:24:26 -05:00
John Helmert
d793781089 Minor formatting cleanup in mime_parsers.py 2019-06-18 14:46:58 -05:00
geeseven
9a8f717b37 add Twitch mime parser 2019-06-18 18:56:33 +00:00
John Helmert
1784f10d0b Version bump 2019-06-12 21:26:14 -05:00
John Helmert
4f37dd1710 Add full test coverage for Content.humanize_timestamp 2019-06-12 21:00:02 -05:00
John Helmert
29461f5f88 Migrate Imgur API key to new one generated for TUIR 2019-06-10 11:08:51 -05:00
John Helmert
337180c2c8 Version bump - hotfix 2019-06-09 22:15:33 -05:00
John Helmert
7c51032acd Revert "Replace deprecated ConfigParser method"
This reverts commit de1d06e33c. It breaks
running with python2.7
2019-06-09 21:44:08 -05:00
John Helmert
3cd9b2db46 Version bump 2019-06-09 21:38:50 -05:00
John Helmert
304096f8d8 Revert to old clipboard default xclip command 2019-06-09 21:24:16 -05:00
John Helmert
7e9455b4ca Rename rtv to tuir 2019-06-09 19:31:35 -05:00