Commit Graph

1697 Commits

Author SHA1 Message Date
armandg d5a869348f Added a Markdown cheat sheet in instructions when commenting/posting/editing 2020-02-05 11:54:27 -06:00
John Helmert III 4b0bd95a5e Add basic test for Terminal._load_mailcaps() 2019-11-16 21:10:23 -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
Francesco Turco 47cf551add fix typo 2019-11-12 17:23:26 +01:00
John Helmert III 4a2298b05c Gitignore tags files 2019-10-18 20:28:31 -05:00
John Helmert dd8062a2f4 Merge branch 'geeseven/tuir-help-fix-url'
Fixes typo in the link to this project in the help page displayed from
inside TUIR. "github" -> "gitlab"
2019-09-25 15:23:22 -05:00
geeseven 6c2c6fc900 fix project URL in [?]Help 2019-09-24 19:46:48 +00:00
John Helmert 16fbe589e2 Update scripts/RELEASE_CHECKLIST.md
The list has had several changes - modifications relevant to the switch
between GitHub and Gitlab, and commit tagging information is now noted.

Importantly, the "Packaging Guide" was removed because it didn't add
anything to the document that wasn't already in the checklist, and the
"PyPI Credentials" section was removed because storing credentials in
plaintext is a bad idea so following it makes little sense.
2019-09-16 14:32:38 -05: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 e6ee83adf6 Add mention of TUIR AUR package to README
Closes #14.
2019-09-09 15:41:31 -05:00
John Helmert 0238501e2b Add support for parsing [rtv] config sections, bug #13 2019-09-02 16:55:15 -05:00
John Helmert 55dd37a532 Allow experimental Python 3.8 to fail CI test 2019-08-27 16:42:46 -05:00
John Helmert dc320ff603 Fix Python 3.8 Docker image name 2019-08-26 17:36:28 -05:00
John Helmert fd93b0cb08 Switch Gitlab CI Docker images to Debian Buster 2019-08-26 17:26:31 -05:00
John Helmert 0f25df4a64 Add Gitlab CI tests for Python 3.{5,7,8} 2019-08-26 17:13:10 -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 423ef5bd84 Update README clipboard information to reflect changes 2019-08-03 22:44:01 -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 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