Skip to content

Commit a67ebf3

Browse files
Thomas Rabaixrande
authored andcommitted
feat(resources): add support for a more flatten organisation
1 parent 303ebb8 commit a67ebf3

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/references/extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Here a flask extension, ``ioc.extra.flask.di.Extension``
1717
1818
# load an external file defining services
1919
loader = ioc.loader.YamlLoader()
20-
loader.load("%s/resources/config/flask.yml" % path, container_builder)
20+
loader.load("%s/config/flask.yml" % path, container_builder)
2121
2222
# set default parameters into the container to be reuse by the container builder
2323
# or by external services
@@ -125,4 +125,4 @@ shirka configuration defined inside the ``config.yml`` file::
125125
base_url: '/shirka/api'
126126
data_dir: '%base_dir%/data'
127127

128-
So through some configuration, the user can configure how the Flask action will be expose ``/shirka/api``.
128+
So through some configuration, the user can configure how the Flask action will be expose ``/shirka/api``.

ioc/extra/jinja2/di.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def load(self, config, container_builder):
3333
mapping[name] = jinja2.FileSystemLoader([
3434
"%s/resources/%s/templates" % (container_builder.parameters.get('project.root_folder'), name),
3535
"%s/resources/templates" % os.path.dirname(importlib.import_module(name).__file__),
36+
"%s/templates" % os.path.dirname(importlib.import_module(name).__file__),
3637
])
3738

3839
container_builder.parameters.set("ioc.extra.jinja2.loader_mapping", mapping)

ioc/extra/locator/di.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def load(self, config, container_builder):
2525
for extension in extensions:
2626
arguments = [[
2727
Definition('ioc.locator.FileSystemLocator', arguments=["%s/resources/%s" % (container_builder.parameters.get('project.root_folder'), extension)]),
28-
Definition('ioc.locator.PackageLocator', arguments=[extension], kwargs={'package_path': 'resources'})
28+
Definition('ioc.locator.PackageLocator', arguments=[extension], kwargs={'package_path': 'resources'}),
29+
Definition('ioc.locator.PackageLocator', arguments=[extension], kwargs={'package_path': ''})
2930
]]
3031

3132
locator_map[extension] = Definition('ioc.locator.ChoiceLocator', arguments=arguments)

0 commit comments

Comments
 (0)