diff --git a/CHANGES.rst b/CHANGES.rst index 44b99e04..7bee5b38 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,7 @@ Changelog ========= -Unreleased Changes +0.6.0 (2017-11-11) ------------------ * `PR #140 `_ - Support user-configurable currencies and currency formatting. diff --git a/biweeklybudget/version.py b/biweeklybudget/version.py index 140a1b39..5a4701d1 100644 --- a/biweeklybudget/version.py +++ b/biweeklybudget/version.py @@ -35,5 +35,5 @@ ################################################################################ """ -VERSION = '0.5.0' +VERSION = '0.6.0' PROJECT_URL = 'https://github.com/jantman/biweeklybudget' diff --git a/dev/github_releaser.py b/dev/github_releaser.py index f9f730cc..e7a819aa 100644 --- a/dev/github_releaser.py +++ b/dev/github_releaser.py @@ -156,7 +156,7 @@ def _get_markdown(self): markdown = subprocess.check_output(cmd) buf = '' in_ver = False - for line in markdown.split("\n"): + for line in markdown.decode().split("\n"): if not in_ver and line.startswith('## %s ' % _VERSION): in_ver = True elif in_ver and line.startswith('## '): diff --git a/dev/release.py b/dev/release.py index 25a971e1..aae8ce72 100755 --- a/dev/release.py +++ b/dev/release.py @@ -161,6 +161,8 @@ def run(self): @steps.register(6) class EnsurePushed(BaseStep): + always_run = True + def run(self): self._ensure_pushed() @@ -177,7 +179,7 @@ def run(self): if result is not True: input('Revise Changelog and then press any key.') continue - url = self._gist(md) + url = self._gh._gist(md) logger.info('Gist URL: <%s>', url) result = prompt_user('Does the gist at <%s> look right?' % url) self._ensure_pushed() @@ -186,6 +188,8 @@ def run(self): @steps.register(8) class ConfirmTravisAndCoverage(BaseStep): + always_run = True + def run(self): commit = self._current_commit logger.info('Polling for finished TravisCI build of %s', commit) @@ -244,9 +248,9 @@ def run(self): res.returncode, res.stdout.decode() ) fail('%s failed.' % ' '.join(cmd)) - cmd = ['twine', 'upload', '-r', 'test', 'dist/*'] + cmd = ' '.join(['twine', 'upload', '-r', 'test', 'dist/*']) logger.info( - 'Running: %s (cwd=%s)', ' '.join(cmd), projdir + 'Running: %s (cwd=%s)', cmd, projdir ) res = subprocess.run( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -503,16 +507,17 @@ def run(self): 'the release is complete.', VERSION ) raise SystemExit(1) - is_git_dirty(raise_on_dirty=True) self.release_issue_num = self._release_issue_number if self.release_issue_num is None: self.release_issue_num = self._open_release_issue() + self._record_successful_step(0) + is_git_dirty(raise_on_dirty=True) last_step = self._last_step for stepnum in steps.step_numbers: - if stepnum <= last_step: + cls = steps.step(stepnum) + if stepnum <= last_step and not cls.always_run: logger.debug('Skipping step %d - already completed', stepnum) continue - cls = steps.step(stepnum) logger.info('Running step %d (%s)', stepnum, cls.__name__) cls(self.gh, self.travis, self.release_issue_num).run() self._record_successful_step(stepnum) @@ -589,4 +594,3 @@ def _open_release_issue(self): ) ) ).run() - raise NotImplementedError('Uncomment is_git_dirty call in run()') diff --git a/dev/release_utils.py b/dev/release_utils.py index dce340ad..5873a150 100644 --- a/dev/release_utils.py +++ b/dev/release_utils.py @@ -135,7 +135,7 @@ def _latest_travis_build(self, commit): b = self._travis.builds( slug='jantman/biweeklybudget', number=bnum )[0] - if b.commit_id == commit: + if b.commit.sha == commit: return b return None @@ -179,6 +179,8 @@ def step(self, stepnum): class BaseStep(object): + always_run = False + def __init__(self, github_releaser, travis_checker, issue_num): self._gh = github_releaser self._travis = travis_checker @@ -189,13 +191,18 @@ def run(self): @property def _current_branch(self): - res = subprocess.run(['git', 'rev-parse', '--abbrev-ref', 'HEAD']) - return res.stdout.strip() + res = subprocess.run( + ['git', 'rev-parse', '--abbrev-ref', 'HEAD'], + stdout=subprocess.PIPE + ) + return res.stdout.decode().strip() @property def _current_commit(self): - res = subprocess.run(['git', 'rev-parse', 'HEAD']) - return res.stdout.strip() + res = subprocess.run( + ['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE + ) + return res.stdout.decode().strip() def _ensure_committed(self): while is_git_dirty(): @@ -211,8 +218,9 @@ def _ensure_pushed(self): subprocess.run(['git', 'fetch']) local_ref = self._current_commit rmt_ref = subprocess.run( - ['git', 'rev-parse', 'origin/%s' % self._current_branch] - ).stdout.strip() + ['git', 'rev-parse', 'origin/%s' % self._current_branch], + stdout=subprocess.PIPE + ).stdout.decode().strip() pushed = local_ref == rmt_ref if not pushed: input( diff --git a/docs/source/account1.png b/docs/source/account1.png index dc72b026..18010e0f 100644 Binary files a/docs/source/account1.png and b/docs/source/account1.png differ diff --git a/docs/source/account1_sm.png b/docs/source/account1_sm.png index c018fe7d..17adc042 100644 Binary files a/docs/source/account1_sm.png and b/docs/source/account1_sm.png differ diff --git a/docs/source/accounts.png b/docs/source/accounts.png index 2b7a4d32..9a2481e1 100644 Binary files a/docs/source/accounts.png and b/docs/source/accounts.png differ diff --git a/docs/source/accounts_sm.png b/docs/source/accounts_sm.png index 25374bc9..f75a76ec 100644 Binary files a/docs/source/accounts_sm.png and b/docs/source/accounts_sm.png differ diff --git a/docs/source/budget2.png b/docs/source/budget2.png index 1f26e9cf..99868498 100644 Binary files a/docs/source/budget2.png and b/docs/source/budget2.png differ diff --git a/docs/source/budget2_sm.png b/docs/source/budget2_sm.png index 7f529086..a39918ce 100644 Binary files a/docs/source/budget2_sm.png and b/docs/source/budget2_sm.png differ diff --git a/docs/source/budgets.png b/docs/source/budgets.png index 01d6d8a1..33eb9bf5 100644 Binary files a/docs/source/budgets.png and b/docs/source/budgets.png differ diff --git a/docs/source/budgets_sm.png b/docs/source/budgets_sm.png index ba9b3512..d2c0247f 100644 Binary files a/docs/source/budgets_sm.png and b/docs/source/budgets_sm.png differ diff --git a/docs/source/credit-payoff.png b/docs/source/credit-payoff.png index 80776b5f..506c0fb4 100644 Binary files a/docs/source/credit-payoff.png and b/docs/source/credit-payoff.png differ diff --git a/docs/source/credit-payoff_sm.png b/docs/source/credit-payoff_sm.png index e91361a7..39c88f47 100644 Binary files a/docs/source/credit-payoff_sm.png and b/docs/source/credit-payoff_sm.png differ diff --git a/docs/source/fuel.png b/docs/source/fuel.png index 29b3ba46..0e13c1d6 100644 Binary files a/docs/source/fuel.png and b/docs/source/fuel.png differ diff --git a/docs/source/fuel_sm.png b/docs/source/fuel_sm.png index 620453d6..017540e8 100644 Binary files a/docs/source/fuel_sm.png and b/docs/source/fuel_sm.png differ diff --git a/docs/source/index.png b/docs/source/index.png index 847ef894..b2e43680 100644 Binary files a/docs/source/index.png and b/docs/source/index.png differ diff --git a/docs/source/index_sm.png b/docs/source/index_sm.png index b5fc6f4f..86601970 100644 Binary files a/docs/source/index_sm.png and b/docs/source/index_sm.png differ diff --git a/docs/source/jsdoc.custom.rst b/docs/source/jsdoc.custom.rst index e24833da..c14389c1 100644 --- a/docs/source/jsdoc.custom.rst +++ b/docs/source/jsdoc.custom.rst @@ -5,7 +5,12 @@ File: ``biweeklybudget/flaskapp/static/js/custom.js`` .. js:function:: fmt_currency(value) - Format a float as currency + Format a float as currency. If ``value`` is null, return `` ``. + Otherwise, construct a new instance of ``Intl.NumberFormat`` and use it to + format the currency to a string. The formatter is called with the + ``LOCALE_NAME`` and ``CURRENCY_CODE`` variables, which are templated into + the header of ``base.html`` using the values specified in the Python + settings module. :param number value: the number to format :returns: **string** -- The number formatted as currency diff --git a/docs/source/payperiod.png b/docs/source/payperiod.png index a969a041..8a5034aa 100644 Binary files a/docs/source/payperiod.png and b/docs/source/payperiod.png differ diff --git a/docs/source/payperiod_sm.png b/docs/source/payperiod_sm.png index ddcaba39..34f7e398 100644 Binary files a/docs/source/payperiod_sm.png and b/docs/source/payperiod_sm.png differ diff --git a/docs/source/payperiods.png b/docs/source/payperiods.png index 05c88ab7..2c3a062d 100644 Binary files a/docs/source/payperiods.png and b/docs/source/payperiods.png differ diff --git a/docs/source/payperiods_sm.png b/docs/source/payperiods_sm.png index 026af1a6..d004cdba 100644 Binary files a/docs/source/payperiods_sm.png and b/docs/source/payperiods_sm.png differ