Skip to content

Commit 133be58

Browse files
authored
Merge pull request #68 from moremoban/lml3-optimization
✨ template types using the same template engine will be grouped
2 parents 3c39d60 + 1023661 commit 133be58

File tree

8 files changed

+30
-20
lines changed

8 files changed

+30
-20
lines changed

.moban.cd/changelog.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Updated
6+
details:
7+
- templates using the same template engine will be templated as a group
8+
- update lml dependency to 0.0.3
9+
date: unreleased
10+
version: 0.2.1
411
- changes:
512
- action: Added
613
details:

.moban.cd/moban.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ organisation: moremoban
33
author: C. W.
44
55
license: MIT
6-
version: 0.2.0
7-
current_version: 0.2.0
6+
version: 0.2.1
7+
current_version: 0.2.1
88
release: 0.2.0
99
branch: master
1010
command_line_interface: "moban"
@@ -15,7 +15,7 @@ keywords:
1515
dependencies:
1616
- pyyaml>=3.11
1717
- jinja2>=2.7.1
18-
- lml==0.0.2
18+
- lml==0.0.3
1919
- crayons
2020
description: Yet another jinja2 cli command for static text generation
2121
scm_host: github.com

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Change log
22
================================================================================
33

4+
0.2.1 - unreleased
5+
--------------------------------------------------------------------------------
6+
7+
Updated
8+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
10+
#. templates using the same template engine will be templated as a group
11+
#. update lml dependency to 0.0.3
12+
413
0.2.0 - 11-06-2018
514
--------------------------------------------------------------------------------
615

moban/engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def __init__(self, template_dirs, context_dirs):
6969
for test_name, test_function in _TESTS.get_all():
7070
self.jj2_environment.tests[test_name] = test_function
7171

72-
for global_name, helper_obj in _GLOBALS.get_all():
73-
self.jj2_environment.globals[global_name] = helper_obj.payload
72+
for global_name, dict_obj in _GLOBALS.get_all():
73+
self.jj2_environment.globals[global_name] = dict_obj
7474

7575
self.context = Context(context_dirs)
7676
self.template_dirs = template_dirs

moban/extensions.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ def __init__(self):
6464
)
6565

6666

67-
class PluginHelper(object):
68-
69-
def __init__(self, identifier, payload_obj):
70-
self.payload = payload_obj
71-
self.__name__ = identifier
72-
73-
7467
def jinja_global(identifier, dict_obj):
7568
plugin = PluginInfo(constants.JINJA_GLOBALS_EXTENSION, tags=[identifier])
76-
helper = PluginHelper(identifier, dict_obj)
77-
plugin(helper)
69+
plugin(dict_obj)

moban/mobanfile.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ def handle_targets(merged_options, targets):
3434
for file_list in list_of_templating_parameters:
3535
_, extension = os.path.splitext(file_list[0])
3636
template_type = extension[1:]
37-
if template_type not in ENGINES.all_types():
38-
template_type = merged_options[constants.LABEL_TEMPLATE_TYPE]
39-
jobs_for_each_engine[template_type].append(file_list)
37+
primary_template_type = ENGINES.get_primary_key(template_type)
38+
if primary_template_type is None:
39+
primary_template_type = merged_options[
40+
constants.LABEL_TEMPLATE_TYPE]
41+
jobs_for_each_engine[primary_template_type].append(file_list)
4042

4143
count = 0
4244
for template_type in jobs_for_each_engine.keys():

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pyyaml>=3.11
22
jinja2>=2.7.1
3-
lml==0.0.2
3+
lml==0.0.3
44
crayons

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
NAME = 'moban'
1313
AUTHOR = 'C. W.'
14-
VERSION = '0.2.0'
14+
VERSION = '0.2.1'
1515
1616
LICENSE = 'MIT'
1717
ENTRY_POINTS = {
@@ -46,7 +46,7 @@
4646
INSTALL_REQUIRES = [
4747
'pyyaml>=3.11',
4848
'jinja2>=2.7.1',
49-
'lml==0.0.2',
49+
'lml==0.0.3',
5050
'crayons',
5151
]
5252
SETUP_COMMANDS = {}

0 commit comments

Comments
 (0)