Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .moban.cd/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
name: moban
organisation: moremoban
releases:
- changes:
- action: Updated
details:
- |
since version 0.5.0, when rendering a single file or string, moban would report
'Templated 1 of 0 files', which should have been 'Templated 1 file.'
- action: Removed
details:
- |
python 3.4 support is gone because colorama requires
Python '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*'
date: 7.12.2019
version: 0.6.8
- changes:
- action: Updated
details:
Expand Down
6 changes: 3 additions & 3 deletions .moban.cd/moban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ organisation: moremoban
author: C. W.
contact: wangc_2011@hotmail.com
license: MIT
version: 0.6.7
current_version: 0.6.7
release: 0.6.7
version: 0.6.8
current_version: 0.6.8
release: 0.6.8
branch: master
master: index
command_line_interface: "moban"
Expand Down
3 changes: 1 addition & 2 deletions .moban.d/moban_travis.yml.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ python:
- 3.7
- 3.6
- 3.5
- 3.4
- 2.7
- 3.8-dev
- 3.8
{%endblock%}
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ python:
- 3.7
- 3.6
- 3.5
- 3.4
- 2.7
- 3.8-dev
- 3.8
env:
- MINREQ=0
- MINREQ=1
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
Change log
================================================================================

0.6.8 - 7.12.2019
--------------------------------------------------------------------------------

**Updated**

#. since version 0.5.0, when rendering a single file or string, moban would
report 'Templated 1 of 0 files', which should have been 'Templated 1 file.'

**Removed**

#. python 3.4 support is gone because colorama requires Python '>=2.7, !=3.0.*,
!=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*'

0.6.7 - 1.12.2019
--------------------------------------------------------------------------------

Expand Down
15 changes: 10 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ haml, slim and tornado, can read other data format: json and yaml, and can acces
template file and configuration file in
any location: zip, git, pypi package, s3, etc.

Please look at our issues. We have many more template engines and data format on the
road map.

All use cases are documented `here <http://moban.readthedocs.org/en/latest/#tutorial>`_

Support
================================================================================

Expand Down Expand Up @@ -76,6 +71,10 @@ or clone it and install it:
Quick start
================================================================================


.. image:: https://github.com/moremoban/moban/raw/dev/docs/images/moban-in-intro.gif


.. code-block:: bash

$ export HELLO="world"
Expand Down Expand Up @@ -120,6 +119,12 @@ moban.output will contain::

Please note that data.yml will take precedence over environment variables.

Moban in live action:

.. image:: https://github.com/moremoban/moban/raw/dev/docs/images/moban-in-pyexcel-demo.gif

All use cases are documented `here <http://moban.readthedocs.org/en/latest/#tutorial>`_


Work with files in a git repo
================================================================================
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
copyright = '2017-2019 Onni Software Ltd.'
author = 'C. W.'
# The short X.Y version
version = '0.6.7'
version = '0.6.8'
# The full version, including alpha/beta/rc tags
release = '0.6.7'
release = '0.6.8'

# -- General configuration ---------------------------------------------------

Expand Down
Binary file added docs/images/moban-in-intro.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/moban-in-pyexcel-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion moban/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.6.7"
__version__ = "0.6.8"
__author__ = "C. W."
3 changes: 3 additions & 0 deletions moban/core/moban_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def render_to_file(self, template_file, data_file, output_file):
self.engine_action, template_file, output_file
)
self.templated_count += 1
self.file_count += 1

self.buffered_writer.close()

def render_string_to_file(
Expand All @@ -151,6 +153,7 @@ def render_string_to_file(
self.engine_action, template_abs_path, output_file
)
self.templated_count += 1
self.file_count += 1
self.buffered_writer.close()

def apply_template(self, template_abs_path, template, data, output_file):
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

NAME = "moban"
AUTHOR = "C. W."
VERSION = "0.6.7"
VERSION = "0.6.8"
EMAIL = "wangc_2011@hotmail.com"
LICENSE = "MIT"
ENTRY_POINTS = {
Expand All @@ -50,7 +50,7 @@
"Yet another jinja2 cli command for static text generation"
)
URL = "https://github.com/moremoban/moban"
DOWNLOAD_URL = "%s/archive/0.6.7.tar.gz" % URL
DOWNLOAD_URL = "%s/archive/0.6.8.tar.gz" % URL
FILES = ["README.rst", "CONTRIBUTORS.rst", "CHANGELOG.rst"]
KEYWORDS = [
"python",
Expand Down Expand Up @@ -97,8 +97,8 @@
}
# You do not need to read beyond this line
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
GS_COMMAND = ("gs moban v0.6.7 " +
"Find 0.6.7 in changelog for more details")
GS_COMMAND = ("gs moban v0.6.8 " +
"Find 0.6.8 in changelog for more details")
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
"Please install gease to enable it.")
UPLOAD_FAILED_MSG = (
Expand Down
15 changes: 15 additions & 0 deletions tests/core/test_moban_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ def test_file_tests():
with open(output, "r") as output_file:
content = output_file.read()
eq_(content, "yes\nhere")
eq_(engine.file_count, 1)
eq_(engine.templated_count, 1)
os.unlink(output)


def test_render_string_to_file():
output = "test.txt"
path = fs.path.join("tests", "fixtures", "jinja_tests")
engine = ENGINES.get_engine("jinja2", [path], path)
engine.render_string_to_file("{{test}}", "file_tests.yml", output)
with open(output, "r") as output_file:
content = output_file.read()
eq_(content, "here")
eq_(engine.file_count, 1)
eq_(engine.templated_count, 1)
os.unlink(output)


Expand Down