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
7 changes: 7 additions & 0 deletions .moban.cd/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: moban
organisation: moremoban
releases:
- changes:
- action: Updated
details:
- "Command options have been grouped. --template_type became --template-type"
- "Increment gitfs2 to version 0.0.2. `gitfs#4`"
date: 4.10.2019
version: 0.6.4
- changes:
- action: Added
details:
Expand Down
8 changes: 4 additions & 4 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.3
current_version: 0.6.3
release: 0.6.3
version: 0.6.4
current_version: 0.6.4
release: 0.6.4
branch: master
master: index
command_line_interface: "moban"
Expand All @@ -27,7 +27,7 @@ dependencies:
- appdirs>=1.4.3
- crayons>= 0.1.0
- fs>=2.4.11
- gitfs2>=0.0.1
- gitfs2>=0.0.2
- pypifs>=0.0.1
- jinja2-fsloader>=0.2.0
description: Yet another jinja2 cli command for static text generation
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Change log
================================================================================

0.6.4 - 4.10.2019
--------------------------------------------------------------------------------

Updated
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

#. Command options have been grouped. --template_type became --template-type
#. Increment gitfs2 to version 0.0.2. `gitfs#4
<https://github.com/moremoban/gitfs/issues/4>`_

0.6.3 - 25.09.2019
--------------------------------------------------------------------------------

Expand Down
53 changes: 32 additions & 21 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,51 +171,62 @@ Then you can access your files in s3 bucket:
Where the configuration sits in a s3 bucket, the output is a file in a zip. The content of s3data.yaml is::

hello: world


Usage


CLI documentation
================================================================================

.. code-block:: bash


usage: moban [-h] [-cd CONFIGURATION_DIR] [-c CONFIGURATION]
[-td [TEMPLATE_DIR [TEMPLATE_DIR ...]]] [-t TEMPLATE] [-o OUTPUT]
[--template_type TEMPLATE_TYPE] [-f] [--exit-code] [-m MOBANFILE]
[-g GROUP] [-V] [-v] [-D DEFINE [DEFINE ...]]
usage: moban [-h] [-c CONFIGURATION] [-t TEMPLATE] [-o OUTPUT]
[-td [TEMPLATE_DIR [TEMPLATE_DIR ...]]] [-cd CONFIGURATION_DIR]
[-m MOBANFILE] [-g GROUP] [--template-type TEMPLATE_TYPE]
[-d DEFINE [DEFINE ...]] [-e EXTENSION [EXTENSION ...]] [-f]
[--exit-code] [-V] [-v]
[template]

Yet another jinja2 cli command for static text generation
Static text generator using any template, any data and any location.

positional arguments:
template string templates

optional arguments:
-h, --help show this help message and exit
-cd CONFIGURATION_DIR, --configuration_dir CONFIGURATION_DIR
the directory for configuration file lookup
-c CONFIGURATION, --configuration CONFIGURATION
the dictionary file
-td [TEMPLATE_DIR [TEMPLATE_DIR ...]], --template_dir [TEMPLATE_DIR [TEMPLATE_DIR ...]]
the directories for template file lookup
the data file
-t TEMPLATE, --template TEMPLATE
the template file
-o OUTPUT, --output OUTPUT
the output file
--template_type TEMPLATE_TYPE
the template type, default is jinja2
-f force moban to template all files despite of
.moban.hashes
--exit-code tell moban to change exit code

Advanced options:
For better control

-td [TEMPLATE_DIR [TEMPLATE_DIR ...]], --template_dir [TEMPLATE_DIR [TEMPLATE_DIR ...]]
add more directories for template file lookup
-cd CONFIGURATION_DIR, --configuration_dir CONFIGURATION_DIR
the directory for configuration file lookup
-m MOBANFILE, --mobanfile MOBANFILE
custom moban file
-g GROUP, --group GROUP
a subset of targets
-V, --version show program's version number and exit
-v show verbose
--template-type TEMPLATE_TYPE
the template type, default is jinja2
-d DEFINE [DEFINE ...], --define DEFINE [DEFINE ...]
to take a list of VAR=VALUEs
to supply additional or override predefined variables,
format: VAR=VALUEs
-e EXTENSION [EXTENSION ...], --extension EXTENSION [EXTENSION ...]
to to TEMPLATE_TYPE=EXTENSION_NAME
-f force moban to template all files despite of
.moban.hashes

Developer options:
For debugging and development

--exit-code tell moban to change exit code
-V, --version show program's version number and exit
-v show verbose, try -v, -vv

Exit codes
--------------------------------------------------------------------------------
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.3'
version = '0.6.4'
# The full version, including alpha/beta/rc tags
release = '0.6.3'
release = '0.6.4'

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

Expand Down
2 changes: 1 addition & 1 deletion min_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ lml==0.0.9
appdirs==1.4.3
crayons== 0.1.0
fs==2.4.11
gitfs2==0.0.1
gitfs2==0.0.2
pypifs==0.0.1
jinja2-fsloader==0.2.0
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.3"
__version__ = "0.6.4"
__author__ = "C. W."
2 changes: 1 addition & 1 deletion moban/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Configurations
PROGRAM_NAME = "moban"
PROGRAM_DESCRIPTION = (
"Yet another jinja2 cli command for static " + "text generation"
"Static text generator using any template, any data and any location."
)
DEFAULT_YAML_SUFFIX = ".yml"
# .moban.yml, default moban configuration file
Expand Down
91 changes: 50 additions & 41 deletions moban/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,80 +89,89 @@ def create_parser():
prog=constants.PROGRAM_NAME, description=constants.PROGRAM_DESCRIPTION
)
parser.add_argument(
"-cd",
"--%s" % constants.LABEL_CONFIG_DIR,
help="the directory for configuration file lookup",
"-c", "--%s" % constants.LABEL_CONFIG, help="the data file"
)
parser.add_argument(
"-t", "--%s" % constants.LABEL_TEMPLATE, help="the template file"
)
parser.add_argument(
"-c", "--%s" % constants.LABEL_CONFIG, help="the dictionary file"
"-o", "--%s" % constants.LABEL_OUTPUT, help="the output file"
)
parser.add_argument(
constants.POSITIONAL_LABEL_TEMPLATE,
metavar="template",
type=str,
nargs="?",
help="string templates",
)
advanced = parser.add_argument_group(
"Advanced options", "For better control"
)
advanced.add_argument(
"-td",
"--%s" % constants.LABEL_TMPL_DIRS,
nargs="*",
help="the directories for template file lookup",
help="add more directories for template file lookup",
)
parser.add_argument(
"-t", "--%s" % constants.LABEL_TEMPLATE, help="the template file"
advanced.add_argument(
"-cd",
"--%s" % constants.LABEL_CONFIG_DIR,
help="the directory for configuration file lookup",
)
parser.add_argument(
"-o", "--%s" % constants.LABEL_OUTPUT, help="the output file"
advanced.add_argument(
"-m", "--%s" % constants.LABEL_MOBANFILE, help="custom moban file"
)
parser.add_argument(
"--%s" % constants.LABEL_TEMPLATE_TYPE,
advanced.add_argument(
"-g", "--%s" % constants.LABEL_GROUP, help="a subset of targets"
)
advanced.add_argument(
"--%s" % constants.LABEL_TEMPLATE_TYPE.replace("_", "-"),
help="the template type, default is jinja2",
)
parser.add_argument(
advanced.add_argument(
"-d",
"--%s" % constants.LABEL_DEFINE,
nargs="+",
help=(
"to supply additional or override predefined variables,"
+ " format: VAR=VALUEs"
),
)
advanced.add_argument(
"-e",
"--%s" % constants.LABEL_EXTENSION,
nargs="+",
help="to to TEMPLATE_TYPE=EXTENSION_NAME",
)
advanced.add_argument(
"-f",
action="store_true",
dest=constants.LABEL_FORCE,
default=False,
help="force moban to template all files despite of .moban.hashes",
)
parser.add_argument(
developer = parser.add_argument_group(
"Developer options", "For debugging and development"
)
developer.add_argument(
"--%s" % constants.LABEL_EXIT_CODE,
action="store_true",
dest=constants.LABEL_EXIT_CODE,
default=False,
help="tell moban to change exit code",
)
parser.add_argument(
"-m", "--%s" % constants.LABEL_MOBANFILE, help="custom moban file"
)
parser.add_argument(
"-g", "--%s" % constants.LABEL_GROUP, help="a subset of targets"
)
parser.add_argument(
constants.POSITIONAL_LABEL_TEMPLATE,
metavar="template",
type=str,
nargs="?",
help="string templates",
)
parser.add_argument(
developer.add_argument(
"-V",
"--%s" % constants.LABEL_VERSION,
action="version",
version="%(prog)s {v}".format(v=__version__),
)
parser.add_argument(
developer.add_argument(
"-v",
action="count",
dest=constants.LABEL_VERBOSE,
default=0,
help="show verbose",
)
parser.add_argument(
"-d",
"--%s" % constants.LABEL_DEFINE,
nargs="+",
help="to take a list of VAR=VALUEs",
)
parser.add_argument(
"-e",
"--%s" % constants.LABEL_EXTENSION,
nargs="+",
help="to add an extension to TEMPLATE_TYPE=EXTENSION_NAME",
help="show verbose, try -v, -vv",
)
return parser

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ lml>=0.0.9
appdirs>=1.4.3
crayons>= 0.1.0
fs>=2.4.11
gitfs2>=0.0.1
gitfs2>=0.0.2
pypifs>=0.0.1
jinja2-fsloader>=0.2.0
10 changes: 5 additions & 5 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.3"
VERSION = "0.6.4"
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.3.tar.gz" % URL
DOWNLOAD_URL = "%s/archive/0.6.4.tar.gz" % URL
FILES = ["README.rst", "CONTRIBUTORS.rst", "CHANGELOG.rst"]
KEYWORDS = [
"python",
Expand Down Expand Up @@ -81,7 +81,7 @@
"appdirs>=1.4.3",
"crayons>= 0.1.0",
"fs>=2.4.11",
"gitfs2>=0.0.1",
"gitfs2>=0.0.2",
"pypifs>=0.0.1",
"jinja2-fsloader>=0.2.0",
]
Expand All @@ -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.3 " +
"Find 0.6.3 in changelog for more details")
GS_COMMAND = ("gs moban v0.6.4 " +
"Find 0.6.4 in changelog for more details")
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
"Please install gease to enable it.")
UPLOAD_FAILED_MSG = (
Expand Down