Commit Graph

1674 Commits

Author SHA1 Message Date
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
5436dc9fce Add %u to SubredditPage._create_format test 2019-07-25 22:03:41 -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
add8866f73 Add test for SubredditPage._draw_item_format 2019-07-21 14:38:57 -05:00
John Helmert
3716a4d69e Increase test coverage of subreddit_page.py
Most notably, test functions for _submission_attr, _url_attr, _gold_str,
and _create_format have been added. The constructor test has been
modified into two functions that test the default view and nondefault
views.
2019-07-18 18:01:17 -05:00
John Helmert
7f1206e785 Fix failing test which requires default look_and_feel 2019-07-06 13:00:30 -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
de35144214 Refactor tests/test_config.py
Give _copy_settings_file its own tests, and copy_default_*() now don't
test functionality tested by the _copy_settings_file test
2019-07-01 21:21:55 -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
54c4e5866d Gitignore htmlcov 2019-06-29 20:19:05 -05:00
John Helmert
9dbd0549f9 Fix tests in test_object that failed with pytest-5 2019-06-29 19:26:16 -05:00
John Helmert
c5f1500ffb Fix tests for modifications made last commit
SubredditContent now has a constructor that uses a config object, this
simply fixes all the constructions of SubredditContent that caused
errors.
2019-06-29 17:02:16 -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
John Helmert III
ceb864825b Merge branch 'Twitch' into 'master'
add Twitch mime parser

See merge request ajak/tuir!1
2019-06-18 19:40:45 +00: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
c30e2559f7 Add test for OSX copy() to clipboard 2019-06-12 19:49:05 -05:00
John Helmert
7670c47d3f Adjust issue templates to Gitlab syntax 2019-06-12 18:49:10 -05:00
John Helmert
10612dfe6e Remove old templates from Git 2019-06-12 16:00:55 -05:00
John Helmert
3d874e5c6d Remove spaces from Bug Report/Feature Request names 2019-06-12 15:25:27 -05:00
John Helmert
16b691f4f3 Add Repology badge 2019-06-12 12:22:40 -05:00
John Helmert
8d79534496 Attempt to fix Github issue templates for Gitlab 2019-06-12 12:13:42 -05:00
John Helmert
734bd81b5f Add PyPi, gitlab-ci, and code test coverage badges 2019-06-12 12:09:16 -05:00
John Helmert
0a5bfe2d0e Add code coverage testing to gitlab-ci 2019-06-12 11:53:36 -05:00
John Helmert
db0be46523 Add 'Migration from RTV' section to README 2019-06-11 20:52:03 -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
52061c14ac Update gitlab-ci to run a python2 test 2019-06-09 21:51:32 -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
5f7b8bc309 Comment out out-of-date README information
This includes Alex Jarmoszuk's telnet/ssh RTV test, as TUIR is not RTV;
and the package manager installation section, as TUIR is not in any
distribution repositories.
2019-06-09 21:30:30 -05:00
John Helmert
304096f8d8 Revert to old clipboard default xclip command 2019-06-09 21:24:16 -05:00
John Helmert
942e651654 Update test cassette User-Agents to tuir 2019-06-09 21:00:09 -05:00
John Helmert
0b5657d76d Add basic Gitlab CI file 2019-06-09 20:21:02 -05:00
John Helmert
7e9455b4ca Rename rtv to tuir 2019-06-09 19:31:35 -05:00
John Helmert
481780fffa Merge branch 'dev' 2019-06-09 12:31:17 -05:00
John Helmert
1c0afc8a55 More adjustments for new maintainership 2019-06-09 11:05:37 -05:00