For now, the editor_input and edit_file functions do not make sense
outside of the context of an ui. Having them in the content module
was confusing. (See issue fixed by a600855.)
Replace the in-house stubbing by the facilities offered
by pyfakefs for running tests. We don't use `io.open`
anymore, because pyfakefs does not stub it correctly.
We rely on a patched version of pyfakefs, as a few bug
remain in the official repo.
The implementation is designed to be robust to filesystems having integers
or nanosecond stat time.
Added a requirements.txt file for the tests:
`pip install -r tests/requirements.txt` to install the necessary packages
to run the tests.
Fix#13, Fix#14
1. Removed the unicode wrapper around fake_env io
2. Overrided pyfakefs cStringIO with StringIO (Python 2.x)
3. copy_dir will copy file in binary file to the fake filesystem
*unless* they are bib, yaml, txt or md files
4. ui.handle_exception() conserve traceback
Numerous unicode subtelties required diving into pyfakefs and configobj
source code. Unicode on Python 2.x is the worst.
Actually the test not only is expected to fail but it misses a file
which causes an error instead of a failure on python 2. Should be
addressed by #25.
This test is expected to fail. Nose does not handle that yet (treats it as false).
As such, changes have been made to make tests discoverable by unittest.
You may want to uninstall nose and do something like:
alias nosetests="python -m unittest discover"
in your bashrc
Related: #25
Add a theme section in the configuration file to allow users to
set the colors used by different elements of the ui.
Improve the update mechanism so that incremental changes to the
configuration file can be incorporated.
The update is done transparently, and displays a warning message explaining the change.
All the update machinery has been moved to the new update module.
It depends on configobj, is cleaner and simpler than the previous implementation.
It adds comments in the config file, and type verification.
Related: #18
`print_out()` is replaced by `message()`, that redirect the output to
the stdout controlled by the PrintUI instance. Other than that, can be
used the same way as `print()`.
The error was due to python 2 and 3 not playing nice when opening files.
This is probably linked to some botched unicode handling on our part somewhere
else is the package, and needs to be addressed when the `configs` module is
rewritten.
Also addresses some other minor unicode bugs.
Fix#27.
Related #18.
First this brings a change to the paper API: the terminology of bibdata
and bibentry is clarified: now bibentry is a dictionary of the form
{citekey: bibdata} where bibdata corresponds to the actual dictionary of
bibliographic fields and values {author: ..., year: ...}.
Now bibentry is an attribute of the paper object that is generated from
citekey and bibdata.
This commit fixes all tests in particular an issue with citekey in
bibentry not updated.
Also removes prints in tests and deprecated assertEquals.
Usecase tests now fail if the command ask for unexpected inputs.
Removes queries for user input in attach and add commands (for deletion
of a copied document file). The input was not coherent with tests and is
annoying.
Not so clean since trying to change stdout encoding requires accessing
sys.stdout.buffer, so fake_env has to mock this layer also. The basic
differences between p2 and p3 are handled in p3.py.