Merge branch 'master' into fix87
This commit is contained in:
commit
ea2bc7f732
70
changelog.md
Normal file
70
changelog.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## Current master
|
||||
|
||||
[Full Changelog](https://github.com/pubs/pubs/compare/v0.7.0...master)
|
||||
|
||||
|
||||
### Implemented enhancements
|
||||
|
||||
- Better dialog after editing paper [(#142)](https://github.com/pubs/pubs/issues/142)
|
||||
|
||||
- Add a command to open urls ([#139](https://github.com/pubs/pubs/issues/139) by [ksunden](https://github.com/ksunden))
|
||||
|
||||
- More robust cache on version change [(#138)](https://github.com/pubs/pubs/issues/138)
|
||||
|
||||
- Allow utf8 citekeys [(#133)](https://github.com/pubs/pubs/issues/133)
|
||||
|
||||
- Adds tag list completion in `pubs add -t ` [(#130)](https://github.com/pubs/pubs/issues/130)
|
||||
|
||||
- Wider Travis coverage ([#107](https://github.com/pubs/pubs/issues/107) and [#108](https://github.com/pubs/pubs/issues/108))
|
||||
|
||||
- Uses bibtexparser bwriter instead of internal encoder and adds `--ignore-fields` option to export. [(#106)](https://github.com/pubs/pubs/issues/106)
|
||||
|
||||
- Configurable alias descriptions ([#104](https://github.com/pubs/pubs/issues/104) by [wflynny](https://github.com/wflynny))
|
||||
|
||||
- Support year ranges in query [(#102)](https://github.com/pubs/pubs/issues/102)
|
||||
|
||||
|
||||
### Fixed bugs
|
||||
|
||||
- [[#148]](https://github.com/pubs/pubs/issues/148) Fix compatibility with Pyfakefs 3.7 [(#151)](https://github.com/pubs/pubs/pull/151)
|
||||
|
||||
- [[#95]](https://github.com/pubs/pubs/issues/95) Error message when editor is missing [(#141)](https://github.com/pubs/pubs/issues/141)
|
||||
|
||||
- Fixes tests for printing help on `--help` and without argument. [(#137)](https://github.com/pubs/pubs/issues/137)
|
||||
|
||||
- [[#126]](https://github.com/pubs/pubs/issues/126) Removes journal customization [(#127)](https://github.com/pubs/pubs/issues/127)
|
||||
|
||||
- Fixes Travis failure on installing python3 for OSX [(#125)](https://github.com/pubs/pubs/issues/125)
|
||||
|
||||
- [[#119]](https://github.com/pubs/pubs/issues/119) Removes link and DOI customization. [(#124)](https://github.com/pubs/pubs/issues/124)
|
||||
|
||||
- [[#122]](https://github.com/pubs/pubs/issues/122) Fixes common strings [(#123)](https://github.com/pubs/pubs/issues/123)
|
||||
|
||||
- [[#28]](https://github.com/pubs/pubs/issues/28) allow utf8 in citekeys [(#120)](https://github.com/pubs/pubs/issues/120)
|
||||
|
||||
- Fixes field orders to use 'url' and fixes broken test. [(#118)](https://github.com/pubs/pubs/issues/118)
|
||||
|
||||
- [[#25]](https://github.com/pubs/pubs/issues/25) Fix bibtex testcase [(#117)](https://github.com/pubs/pubs/issues/117)
|
||||
|
||||
- [[#103]](https://github.com/pubs/pubs/issues/103) Fixes unicode comparison [(#116)](https://github.com/pubs/pubs/issues/116)
|
||||
|
||||
- [[#95]](https://github.com/pubs/pubs/issues/95) robust handling of DOIs ([#105](https://github.com/pubs/pubs/issues/105) by [wflynny](https://github.com/wflynny))
|
||||
|
||||
- [[#99]](https://github.com/pubs/pubs/issues/99) Print help when no subcommand is provided ([#100](https://github.com/pubs/pubs/issues/100) by [wflynny](https://github.com/wflynny))
|
||||
|
||||
- Fix defaults not used in config. [(#97)](https://github.com/pubs/pubs/issues/97)
|
||||
|
||||
- Fixes content not read from urls because of call to `os.abspath` [(#96)](https://github.com/pubs/pubs/issues/96)
|
||||
|
||||
- [[#93]](https://github.com/pubs/pubs/issues/93) actually save the modifications on `edit -m`. [(#94)](https://github.com/pubs/pubs/issues/94)
|
||||
|
||||
- [[#88]](https://github.com/pubs/pubs/issues/88) Adds proper escaping for
|
||||
arguments in alias plugin. [(#91)](https://github.com/pubs/pubs/issues/91)
|
||||
|
||||
|
||||
## [v0.7.0](https://github.com/pubs/pubs/compare/v0.6.0...v0.7.0) (2017-08-06)
|
||||
|
||||
[Full Changelog](https://github.com/pubs/pubs/compare/v0.6.0...v0.7.0)
|
@ -11,11 +11,11 @@ import subprocess
|
||||
from . import color
|
||||
from . import config
|
||||
from .p3 import _get_raw_stdout, _get_raw_stderr, input, ustr
|
||||
from .content import check_file, read_text_file, write_file, system_path
|
||||
from .content import check_file, read_text_file, write_file
|
||||
|
||||
|
||||
DEBUG = False # unhandled exceptions traces are printed
|
||||
DEBUG_ALL_TRACES = False # handled exceptions traces are printed
|
||||
DEBUG_ALL_TRACES = False # handled exceptions traces are printed
|
||||
# package-shared ui that can be accessed using :
|
||||
# from uis import get_ui
|
||||
# ui = get_ui()
|
||||
@ -45,7 +45,7 @@ def _get_local_editor():
|
||||
|
||||
def get_ui():
|
||||
if _ui is None:
|
||||
return PrintUI(config.load_default_conf()) # no editor support. (#FIXME?)
|
||||
return PrintUI(config.load_default_conf()) # no editor support. (#FIXME?)
|
||||
return _ui
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ class PrintUI(object):
|
||||
kwargs['file'] = self._stderr
|
||||
print('{}: {}'.format(color.dye_err('error', 'error'), message), **kwargs)
|
||||
|
||||
if DEBUG_ALL_TRACES: # if an exception has been raised, print the trace.
|
||||
if DEBUG_ALL_TRACES: # if an exception has been raised, print the trace.
|
||||
if sys.exc_info()[0] is not None:
|
||||
traceback.print_exception(*sys.exc_info)
|
||||
|
||||
@ -159,7 +159,6 @@ class InputUI(PrintUI):
|
||||
pass
|
||||
self.message('Incorrect option.', option_str)
|
||||
|
||||
|
||||
def input_choice(self, options, option_chars, default=None, question=''):
|
||||
"""Ask the user to chose between a set of options. The user is asked
|
||||
to input a char corresponding to the option he chooses.
|
||||
|
@ -125,3 +125,4 @@ You can access the self-documented configuration by using `pubs conf`, and all t
|
||||
- [Tyler Earnest](https://github.com/tmearnest)
|
||||
- [Dennis Wilson](https://github.com/d9w)
|
||||
- [Bill Flynn](https://github.com/wflynny)
|
||||
- [ksunden](https://github.com/ksunden)
|
||||
|
@ -107,11 +107,16 @@ class TestFakeFs(fake_filesystem_unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.rootpath = os.path.abspath(os.path.dirname(__file__))
|
||||
self.homepath = os.path.expanduser('~')
|
||||
self.setUpPyfakefs()
|
||||
self.fs.CreateDirectory(os.path.expanduser('~'))
|
||||
self.fs.CreateDirectory(self.rootpath)
|
||||
os.chdir(self.rootpath)
|
||||
self.reset_fs()
|
||||
|
||||
def reset_fs(self):
|
||||
self._stubber.tearDown() # renew the filesystem
|
||||
self.setUp()
|
||||
"""Reset the fake filesystem"""
|
||||
for dir_name in self.fs.listdir('/'):
|
||||
if dir_name not in ['var', 'tmp']:
|
||||
self.fs.remove_object(os.path.join('/', dir_name))
|
||||
|
||||
self.fs.create_dir(os.path.expanduser('~'))
|
||||
self.fs.create_dir(self.rootpath)
|
||||
os.chdir(self.rootpath)
|
||||
|
@ -1,5 +1,5 @@
|
||||
# those are the additional packages required to run the tests
|
||||
six
|
||||
pyfakefs==3.3
|
||||
pyfakefs
|
||||
ddt
|
||||
mock
|
||||
|
@ -1,7 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import unittest
|
||||
import copy
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
import unittest
|
||||
|
||||
import dotdot
|
||||
from pubs.config import conf
|
||||
# from pubs.config import conf
|
||||
|
||||
# class TestConfig(unittest.TestCase):
|
||||
#
|
||||
|
@ -5,8 +5,7 @@ import os
|
||||
import dotdot
|
||||
import fake_env
|
||||
|
||||
from pubs import content, filebroker, databroker, datacache
|
||||
from pubs.config import conf
|
||||
from pubs import content, databroker, datacache
|
||||
|
||||
import str_fixtures
|
||||
from pubs import endecoder
|
||||
@ -35,7 +34,7 @@ class TestDataBroker(fake_env.TestFakeFs):
|
||||
|
||||
self.assertEqual(db.pull_metadata('citekey1'), page99_metadata)
|
||||
pulled = db.pull_bibentry('citekey1')['Page99']
|
||||
for key, value in pulled.items():
|
||||
for key in pulled.keys():
|
||||
self.assertEqual(pulled[key], page99_bibentry['Page99'][key])
|
||||
self.assertEqual(db.pull_bibentry('citekey1'), page99_bibentry)
|
||||
|
||||
@ -91,4 +90,4 @@ class TestDataBroker(fake_env.TestFakeFs):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main(verbosity=2)
|
||||
|
@ -3,7 +3,6 @@ import unittest
|
||||
import time
|
||||
|
||||
import dotdot
|
||||
import fake_env
|
||||
|
||||
from pubs.datacache import CacheEntrySet
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
import os
|
||||
|
||||
import dotdot
|
||||
import fake_env
|
||||
|
||||
from pubs import endecoder, pretty, color, config
|
||||
|
||||
|
@ -15,14 +15,12 @@ from pyfakefs.fake_filesystem import FakeFileOpen
|
||||
import dotdot
|
||||
import fake_env
|
||||
|
||||
from pubs import pubs_cmd, update, color, content, filebroker, uis, p3, endecoder
|
||||
from pubs import pubs_cmd, color, content, uis, p3, endecoder
|
||||
from pubs.config import conf
|
||||
import configobj
|
||||
|
||||
import str_fixtures
|
||||
import fixtures
|
||||
|
||||
from pubs.commands import init_cmd, import_cmd
|
||||
|
||||
# makes the tests very noisy
|
||||
PRINT_OUTPUT = False
|
||||
@ -68,10 +66,10 @@ class TestInput(unittest.TestCase):
|
||||
ui = uis.InputUI(sample_conf)
|
||||
|
||||
other_input = fake_env.FakeInput(['yes', 'no'],
|
||||
module_list=[uis, color])
|
||||
module_list=[uis])
|
||||
other_input.as_global()
|
||||
self.assertEqual(ui.editor_input(), 'yes')
|
||||
self.assertEqual(ui.editor_input(), 'no')
|
||||
self.assertEqual(ui.editor_input('fake_editor'), 'yes')
|
||||
self.assertEqual(ui.editor_input('fake_editor'), 'no')
|
||||
with self.assertRaises(fake_env.FakeInput.UnexpectedInput):
|
||||
ui.editor_input()
|
||||
|
||||
@ -84,7 +82,6 @@ class CommandTestCase(fake_env.TestFakeFs):
|
||||
def setUp(self, nsec_stat=True):
|
||||
super(CommandTestCase, self).setUp()
|
||||
os.stat_float_times(nsec_stat)
|
||||
# self.fs = fake_env.create_fake_fs([content, filebroker, conf, init_cmd, import_cmd, configobj, update], nsec_stat=nsec_stat)
|
||||
self.default_pubs_dir = os.path.expanduser('~/.pubs')
|
||||
self.default_conf_path = os.path.expanduser('~/.pubsrc')
|
||||
|
||||
@ -180,7 +177,7 @@ class URLContentTestCase(DataCommandTestCase):
|
||||
return p3.urlparse(url).path
|
||||
|
||||
def url_exists(self, url):
|
||||
return self.fs.Exists(self._url_to_path(url))
|
||||
return self.fs.exists(self._url_to_path(url))
|
||||
|
||||
def url_to_byte_content(self, url, ui=None):
|
||||
path = self._url_to_path(url)
|
||||
@ -974,4 +971,4 @@ class TestCache(DataCommandTestCase):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main(verbosity=2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user