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
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.
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).
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.
Add config item clipboard_cmd, with a default of 'pbcopy w' on Darwin
and 'xclip' on everything else. This will allow the user to use any
command for the clipboard, including 'wl-copy' for Wayland (addressing
issue #693 on Github). With his change, significant simplifications
could be made to clipboard.py - the copy_*() functions have been removed
and combined into copy().
With this simplification, the old OSX test is obsolete, and new OSX
tests are needed (need a way to simulate sys.platform).