There were no tests regarding the return value of standarddir.config() and thus
it wasn't caught that it returned None in some cases. This is now fixed by
checking the return of standdarddir.config before calling it and modifying the
corresponding test_validate_exists_rel as well as adding a new
test_validate_rel_config_none.
In UserStyleSheet.transform os.path.isabs was replaced with os.path.exists, a
more fitting condition. Accordingly two test cases needed to include mocks for
os.path.exists and QUrl.fromLocalFile.
Upstream changelog:
Stop dynamic computation of install_requires in setup.py: this doesn't work
well in the presence of the pip 7 wheel cache. Use PEP-426 environment
markers instead (this means we now require setuptools version 0.7 or
newer).
Upstream changelog:
1.3.1:
Fix encoding issue in Python 3
1.3:
Bump version number to 1.3
Simplify example in README
Show extra content in report regardless of test result
Support extra content in JSON format
The code from function validate in class UserStyleSheet has been migrated to
class File. One test had to be modified due to different expected behaviour.
My logic in the validate function of class UserStyleSheet was faulty and
caused the check for encoding to be skipped. This is now fixed and all
tests run successfully.
Function transform is not supposed to raise exceptions, so I wrapped the
call to os.path.join in an if-clause to test if standarddir.config
returns a valid value.
The last commit removed two lines in function validate of class
UserStyleSheet that were expanding the path. As it turns out those two
lines are needed by validate as well as transform, so I outsourced them
to the function they both call at that point.
The former version of UserStyleSheet never actually loaded the css file,
this is now fixed. The changes to class File were rolled back as its
functions are overloaded by UserStyleSheet; a general solution in
classes File and Directory can be implemented when the changes in
UserStyleSheet meet the expectation.
This ist just a first draft to approach issue622
(https://github.com/The-Compiler/qutebrowser/issues/622) and my very
first babysteps with python.
With this change it is possible to set a user-stylesheet with a relative
path, eg.:
:set ui user-stylesheet mystyle.css
where mystyle.css is in the ~/.config/qutebrowser/.