]> Devi Nivas Git - chevron.git/log
chevron.git
4 years agoPass `keep` to recursive calls of `chevron.renderer.render()`
Dylan Brotherston [Sat, 20 Mar 2021 15:57:51 +0000 (02:57 +1100)]
Pass `keep` to recursive calls of `chevron.renderer.render()`

4 years ago[Feature] Add the ability to keep unknown tags
Dylan Brotherston [Sat, 20 Mar 2021 15:14:28 +0000 (02:14 +1100)]
[Feature] Add the ability to keep unknown tags

Add a new option `keep` (default: False) to `chevron.renderer.render()` that allows for unknown tags to be kept in the returned string for later processing, eg: `eval()`.

5 years agoIgnore the vscode folder
Noah Morrison [Sat, 2 Jan 2021 21:43:32 +0000 (16:43 -0500)]
Ignore the vscode folder

5 years agoPass the warn flag around
Noah Morrison [Sat, 2 Jan 2021 21:38:01 +0000 (16:38 -0500)]
Pass the warn flag around

5 years agoAdd option to hide the file system
Noah Morrison [Sat, 2 Jan 2021 21:35:20 +0000 (16:35 -0500)]
Add option to hide the file system

When partials_path is set to None or '', don't try loading from the
file system

5 years agoMerge branch 'binokkio-fix/yaml-loader_GH-78' into main
Noah Morrison [Sat, 2 Jan 2021 21:18:35 +0000 (16:18 -0500)]
Merge branch 'binokkio-fix/yaml-loader_GH-78' into main

5 years agoMerge branch 'fix/yaml-loader_GH-78' of git://github.com/binokkio/chevron into binokk...
Noah Morrison [Sat, 2 Jan 2021 21:17:47 +0000 (16:17 -0500)]
Merge branch 'fix/yaml-loader_GH-78' of git://github.com/binokkio/chevron into binokkio-fix/yaml-loader_GH-78

5 years agoChanged default yaml loader to SafeLoader
Binokkio [Sat, 2 Jan 2021 19:08:07 +0000 (20:08 +0100)]
Changed default yaml loader to SafeLoader

Co-authored-by: Noah Morrison <noah+github@morrison.ph>
5 years agoMerge pull request #88 from tekknolagi/main
Noah Morrison [Sat, 2 Jan 2021 18:58:16 +0000 (13:58 -0500)]
Merge pull request #88 from tekknolagi/main

Add test for keys not in __dict__

5 years agoAdd test for keys not in __dict__
Max Bernstein [Sat, 2 Jan 2021 18:19:19 +0000 (10:19 -0800)]
Add test for keys not in __dict__

See https://github.com/noahmorrison/chevron/pull/87

5 years agoMerge pull request #87 from tekknolagi/main
Noah Morrison [Sat, 2 Jan 2021 18:32:19 +0000 (13:32 -0500)]
Merge pull request #87 from tekknolagi/main

Use getattr instead of _asdict/__getitem__

5 years agoUse getattr instead of _asdict/__getitem__
Max Bernstein [Sat, 2 Jan 2021 18:19:19 +0000 (10:19 -0800)]
Use getattr instead of _asdict/__getitem__

`_asdict` is not public API for `namedtuple`.

You may want to consider using the built-in `string` module, which
implements this kind of `.0`/`.foo` formatting.

5 years agoMerge branch 'master' into fix/yaml-loader_GH-78
Noah Morrison [Sat, 2 Jan 2021 18:00:48 +0000 (13:00 -0500)]
Merge branch 'master' into fix/yaml-loader_GH-78

5 years agoMerge branch 'tchebb-fix-py3-namedtuple' into main
Noah Morrison [Sat, 2 Jan 2021 17:35:03 +0000 (12:35 -0500)]
Merge branch 'tchebb-fix-py3-namedtuple' into main

5 years agoMerge branch 'fix-py3-namedtuple' of git://github.com/tchebb/chevron into tchebb...
Noah Morrison [Sat, 2 Jan 2021 17:34:44 +0000 (12:34 -0500)]
Merge branch 'fix-py3-namedtuple' of git://github.com/tchebb/chevron into tchebb-fix-py3-namedtuple

5 years agoMerge branch 'joshhansen-master_warn' into main
Noah Morrison [Sat, 2 Jan 2021 17:29:05 +0000 (12:29 -0500)]
Merge branch 'joshhansen-master_warn' into main

5 years agoMerge branch 'master_warn' of git://github.com/joshhansen/chevron into joshhansen...
Noah Morrison [Sat, 2 Jan 2021 17:28:53 +0000 (12:28 -0500)]
Merge branch 'master_warn' of git://github.com/joshhansen/chevron into joshhansen-master_warn

5 years agoMerge branch 'tirkarthi-fix-syntax-warning' into main
Noah Morrison [Sat, 2 Jan 2021 17:26:34 +0000 (12:26 -0500)]
Merge branch 'tirkarthi-fix-syntax-warning' into main

5 years agoMerge branch 'fix-syntax-warning' of git://github.com/tirkarthi/chevron into tirkarth...
Noah Morrison [Sat, 2 Jan 2021 17:26:22 +0000 (12:26 -0500)]
Merge branch 'fix-syntax-warning' of git://github.com/tirkarthi/chevron into tirkarthi-fix-syntax-warning

5 years agoMerge branch 'alanyee-patch-2' into main
Noah Morrison [Sat, 2 Jan 2021 17:22:53 +0000 (12:22 -0500)]
Merge branch 'alanyee-patch-2' into main

5 years agoMerge branch 'patch-2' of git://github.com/alanyee/chevron into alanyee-patch-2
Noah Morrison [Sat, 2 Jan 2021 17:22:41 +0000 (12:22 -0500)]
Merge branch 'patch-2' of git://github.com/alanyee/chevron into alanyee-patch-2

5 years agoMerge branch 'alanyee-patch-1' into main
Noah Morrison [Sat, 2 Jan 2021 17:20:48 +0000 (12:20 -0500)]
Merge branch 'alanyee-patch-1' into main

5 years agoMerge branch 'patch-1' of git://github.com/alanyee/chevron into alanyee-patch-1
Noah Morrison [Sat, 2 Jan 2021 17:20:33 +0000 (12:20 -0500)]
Merge branch 'patch-1' of git://github.com/alanyee/chevron into alanyee-patch-1

5 years agoMerge branch 'masell-travis' into main
Noah Morrison [Sat, 2 Jan 2021 17:17:59 +0000 (12:17 -0500)]
Merge branch 'masell-travis' into main

5 years agoMerge branch 'travis' of git://github.com/masell/chevron into masell-travis
Noah Morrison [Sat, 2 Jan 2021 17:17:33 +0000 (12:17 -0500)]
Merge branch 'travis' of git://github.com/masell/chevron into masell-travis

5 years agoMerge branch 'masell-master' into main
Noah Morrison [Sat, 2 Jan 2021 17:11:31 +0000 (12:11 -0500)]
Merge branch 'masell-master' into main

5 years agoExcluding yaml parsing lines from coverage since pyyaml is not a dependency
Binokkio [Sun, 27 Dec 2020 10:24:17 +0000 (11:24 +0100)]
Excluding yaml parsing lines from coverage since pyyaml is not a dependency

5 years agoDefaulting to yaml.FullLoader with hidden cli arg to resolve GH-78
Binokkio [Sun, 27 Dec 2020 10:01:44 +0000 (11:01 +0100)]
Defaulting to yaml.FullLoader with hidden cli arg to resolve GH-78

5 years agoAllow field access for namedtuple in Python 3
Thomas Hebb [Sat, 23 May 2020 03:24:22 +0000 (23:24 -0400)]
Allow field access for namedtuple in Python 3

`namedtuple` in Python 3 does not provide a `__dict__` attribute. See
https://bugs.python.org/issue24931 for rationale why. As such, if we
want to render keys in `namedtuple`s, we need to use its [`_asdict`][1]
method.

[1]: https://docs.python.org/3/library/collections.html#collections.somenamedtuple._asdict

5 years agoAdjust help text
Josh Hansen [Mon, 18 May 2020 06:24:09 +0000 (23:24 -0700)]
Adjust help text

5 years agoAdd newlines to warning output
Josh Hansen [Mon, 18 May 2020 06:20:37 +0000 (23:20 -0700)]
Add newlines to warning output

5 years agoWarn on undefined keys option
Josh Hansen [Mon, 18 May 2020 06:10:48 +0000 (23:10 -0700)]
Warn on undefined keys option

5 years agoAdd specific check for zero and False since False == 0 is True.
Karthikeyan Singaravelan [Fri, 1 May 2020 04:38:30 +0000 (04:38 +0000)]
Add specific check for zero and False since False == 0 is True.

5 years agoFix SyntaxWarning over comparison of literals using is
Karthikeyan Singaravelan [Thu, 9 Apr 2020 14:26:11 +0000 (14:26 +0000)]
Fix SyntaxWarning over comparison of literals using is

6 years agoUpdate renderer.py
Alan Yee [Mon, 25 Nov 2019 18:52:12 +0000 (10:52 -0800)]
Update renderer.py

More efficient to use rpartition over split in this use case

6 years agoUpdate main.py
Alan Yee [Mon, 25 Nov 2019 18:43:17 +0000 (10:43 -0800)]
Update main.py

-Avoid the use of dangerous default values
-Send print statement into stderr
-Use sys.exit instead of exit

6 years agoAdd python 3.8
Martin Asell [Thu, 17 Oct 2019 20:38:43 +0000 (21:38 +0100)]
Add python 3.8

6 years agoTravisCI update
Martin Asell [Thu, 17 Oct 2019 20:09:18 +0000 (21:09 +0100)]
TravisCI update

6 years agoFix indentation when iterating in scope
Martin Asell [Sun, 13 Oct 2019 22:40:24 +0000 (23:40 +0100)]
Fix indentation when iterating in scope

6 years agoMerge pull request #55 from noahmorrison/travis-testing
Noah Morrison [Mon, 22 Apr 2019 00:30:22 +0000 (20:30 -0400)]
Merge pull request #55 from noahmorrison/travis-testing

Seperate Flake8 from Coveralls

6 years agoCap Python to 3.6 to avoid Xenial workaround
Noah Morrison [Sun, 21 Apr 2019 20:08:35 +0000 (16:08 -0400)]
Cap Python to 3.6 to avoid Xenial workaround

Some limitation to travis. Hopefully will be fixed soon?

https://github.com/travis-ci/travis-ci/issues/9815

6 years agoAdd Python 3.7 to the Python list
Noah Morrison [Sun, 21 Apr 2019 20:03:14 +0000 (16:03 -0400)]
Add Python 3.7 to the Python list

6 years agoRun flake8 and publish on Python 3.7
Noah Morrison [Sun, 21 Apr 2019 19:56:56 +0000 (15:56 -0400)]
Run flake8 and publish on Python 3.7

6 years agoRemove flake8 from publish env
Noah Morrison [Sun, 21 Apr 2019 19:52:06 +0000 (15:52 -0400)]
Remove flake8 from publish env

6 years agoSeperate Flake8 from Coveralls
Noah Morrison [Sun, 21 Apr 2019 19:47:05 +0000 (15:47 -0400)]
Seperate Flake8 from Coveralls

6 years agoMerge pull request #54 from dmorrison42/coverage
Noah Morrison [Sun, 21 Apr 2019 00:21:10 +0000 (20:21 -0400)]
Merge pull request #54 from dmorrison42/coverage

Improvements to coverage

6 years agoFlake8 Fixes
Daniel Morrison [Sun, 21 Apr 2019 00:18:02 +0000 (20:18 -0400)]
Flake8 Fixes

6 years agoTest render of partial insde of lambda
Daniel Morrison [Sun, 21 Apr 2019 00:03:46 +0000 (20:03 -0400)]
Test render of partial insde of lambda

6 years agoMark unicode literal handling as Python2
Daniel Morrison [Sat, 20 Apr 2019 23:56:26 +0000 (19:56 -0400)]
Mark unicode literal handling as Python2

6 years agoAdd test for custom falsy handling (#35)
Daniel Morrison [Sat, 20 Apr 2019 23:33:29 +0000 (19:33 -0400)]
Add test for custom falsy handling (#35)

6 years agoIgnore coverage report
Daniel Morrison [Sat, 20 Apr 2019 23:31:12 +0000 (19:31 -0400)]
Ignore coverage report

6 years agoAdd ChevronError to __init__.py
Daniel Morrison [Sat, 20 Apr 2019 23:15:02 +0000 (19:15 -0400)]
Add ChevronError to __init__.py

Required for pytest to pass

6 years agoUpdate Coverage Badge
Daniel Morrison [Sat, 20 Apr 2019 23:13:21 +0000 (19:13 -0400)]
Update Coverage Badge

Point directly to coveralls.io instead of shields.io

6 years agoMerge pull request #53 from dmorrison42/indexed_lookup
Noah Morrison [Wed, 17 Apr 2019 06:57:01 +0000 (02:57 -0400)]
Merge pull request #53 from dmorrison42/indexed_lookup

Implement indexed scopes #52

6 years agoFlake8 cleanup
Daniel Morrison [Tue, 16 Apr 2019 23:26:34 +0000 (19:26 -0400)]
Flake8 cleanup

6 years agoCatch ValueError when trying to parse keys as int
Daniel Morrison [Tue, 16 Apr 2019 23:17:43 +0000 (19:17 -0400)]
Catch ValueError when trying to parse keys as int

6 years agoImplement indexed scopes #52
Daniel Morrison [Tue, 16 Apr 2019 23:03:15 +0000 (19:03 -0400)]
Implement indexed scopes #52

6 years agoMerge pull request #51 from dmorrison42/partial_indentation
Noah Morrison [Sun, 7 Apr 2019 17:12:51 +0000 (13:12 -0400)]
Merge pull request #51 from dmorrison42/partial_indentation

Allow tabs in partial indentation (Fixes #49?)

6 years agoMerge pull request #50 from dmorrison42/missing_key_partial
Noah Morrison [Sun, 7 Apr 2019 17:10:02 +0000 (13:10 -0400)]
Merge pull request #50 from dmorrison42/missing_key_partial

Missing key partial

6 years agoAllow tabs in partial indentation (Fixes #49?)
Daniel Morrison [Sun, 7 Apr 2019 15:59:54 +0000 (11:59 -0400)]
Allow tabs in partial indentation (Fixes #49?)

This appears to be the underlying issue in #49.

Now tabs or spaces can be used to indent partials.

There is some slight possible API breakage changing padding from int.

If desired, a check could be added to check for an int padding.

6 years agoFix #48
Daniel Morrison [Sun, 7 Apr 2019 14:55:57 +0000 (10:55 -0400)]
Fix #48

Turns out some weird scoping things were happening.

The `scopes` variable is being passed throughout by reference.

Which is great (yay speed improvements). In theory. Except...

All operations must therefore operate on scopes by reference.

`scopes = scopes[1:]` used to end a scope updates the reference.
This means the parent call to renderer doesn't leave the scope.

6 years agoAdd test for #48
Daniel Morrison [Sat, 23 Mar 2019 23:07:40 +0000 (19:07 -0400)]
Add test for #48

7 years agoMerge pull request #46 from akosthekiss/manifest-for-readme
Noah Morrison [Sun, 7 Oct 2018 18:14:26 +0000 (14:14 -0400)]
Merge pull request #46 from akosthekiss/manifest-for-readme

Add MANIFEST.in to ensure that README.md is found by setup.py

7 years agoAdd MANIFEST.in to ensure that README.md is found by setup.py
Akos Kiss [Sun, 7 Oct 2018 12:42:28 +0000 (14:42 +0200)]
Add MANIFEST.in to ensure that README.md is found by setup.py

7 years agoBump version (patch)
Noah Morrison [Wed, 3 Oct 2018 14:20:17 +0000 (10:20 -0400)]
Bump version (patch)

7 years agoFix flake8 not realizing this line is python2
Noah Morrison [Wed, 3 Oct 2018 14:19:59 +0000 (10:19 -0400)]
Fix flake8 not realizing this line is python2

7 years agoBump version (minor)
Noah Morrison [Wed, 3 Oct 2018 14:15:33 +0000 (10:15 -0400)]
Bump version (minor)

7 years agoMerge branch 'master' of https://github.com/gber/chevron into gber-master
Noah Morrison [Wed, 3 Oct 2018 13:47:14 +0000 (09:47 -0400)]
Merge branch 'master' of https://github.com/gber/chevron into gber-master

7 years agoFix flake8 error
Noah Morrison [Wed, 3 Oct 2018 13:45:53 +0000 (09:45 -0400)]
Fix flake8 error

7 years agoMerge branch 'master' of https://github.com/jonioni/chevron into jonioni-master
Noah Morrison [Wed, 3 Oct 2018 13:43:32 +0000 (09:43 -0400)]
Merge branch 'master' of https://github.com/jonioni/chevron into jonioni-master

7 years agoMerge branch 'fix-open-unicode' of https://github.com/akosthekiss/chevron into akosth...
Noah Morrison [Wed, 3 Oct 2018 13:38:48 +0000 (09:38 -0400)]
Merge branch 'fix-open-unicode' of https://github.com/akosthekiss/chevron into akosthekiss-fix-open-unicode

7 years agoMerge branch 'fix-lambda-variable' of https://github.com/akosthekiss/chevron
Noah Morrison [Wed, 3 Oct 2018 13:37:29 +0000 (09:37 -0400)]
Merge branch 'fix-lambda-variable' of https://github.com/akosthekiss/chevron

7 years agoForce utf-8 encoding when opening files
Akos Kiss [Tue, 2 Oct 2018 11:31:42 +0000 (13:31 +0200)]
Force utf-8 encoding when opening files

The default `open(..., 'r')` may lead to errors when utf-8 encoded
files are read on a platform with non-utf-8 default locale /
preferred encoding. The `io` package allows to specify `encoding`
for `open` in a Python 2 & 3-compatible way.

7 years agoFix the rendering of lambdas
Akos Kiss [Tue, 2 Oct 2018 09:44:45 +0000 (11:44 +0200)]
Fix the rendering of lambdas

Variables are the most common tag types, yet they were not handled
during the generation of template text for lambda scopes.

7 years agoAdd missing single quotes to dict keys in README examples
Akos Kiss [Mon, 1 Oct 2018 16:37:56 +0000 (18:37 +0200)]
Add missing single quotes to dict keys in README examples

7 years agoOkay, if I can't only run it once, only publish once
Noah Morrison [Tue, 2 Oct 2018 20:59:04 +0000 (16:59 -0400)]
Okay, if I can't only run it once, only publish once

7 years agoHopefully actually only run 3.6 once
Noah Morrison [Tue, 2 Oct 2018 20:54:52 +0000 (16:54 -0400)]
Hopefully actually only run 3.6 once

7 years agoOnly run python 3.6 once, only push to test.pypi on tags
Noah Morrison [Tue, 2 Oct 2018 20:43:54 +0000 (16:43 -0400)]
Only run python 3.6 once, only push to test.pypi on tags

7 years agoMerge branch 'akosthekiss-fix-flake8' into travis-test
Noah Morrison [Tue, 2 Oct 2018 20:39:24 +0000 (16:39 -0400)]
Merge branch 'akosthekiss-fix-flake8' into travis-test

7 years agoBump patch version number for PyPi test
Noah Morrison [Tue, 2 Oct 2018 20:34:12 +0000 (16:34 -0400)]
Bump patch version number for PyPi test

7 years agoMerge branch 'akosthekiss-pypi-deploy-origin-only' into travis-test
Noah Morrison [Tue, 2 Oct 2018 20:32:11 +0000 (16:32 -0400)]
Merge branch 'akosthekiss-pypi-deploy-origin-only' into travis-test

7 years agoActually tell PyPi that the readme is in markdown
Noah Morrison [Tue, 2 Oct 2018 20:28:03 +0000 (16:28 -0400)]
Actually tell PyPi that the readme is in markdown

oops... who reads documentation anyways?

7 years agoChange upload version 3.5 => 3.6
Noah Morrison [Tue, 2 Oct 2018 20:23:26 +0000 (16:23 -0400)]
Change upload version 3.5 => 3.6

7 years agoMissed a / while updating PyPi server locations
Noah Morrison [Tue, 2 Oct 2018 20:17:37 +0000 (16:17 -0400)]
Missed a / while updating PyPi server locations

7 years agoUpdate PyPi server locations
Noah Morrison [Tue, 2 Oct 2018 20:13:14 +0000 (16:13 -0400)]
Update PyPi server locations

7 years agoRemove pandoc, PyPi accepts markdown now
Noah Morrison [Tue, 2 Oct 2018 20:06:56 +0000 (16:06 -0400)]
Remove pandoc, PyPi accepts markdown now

7 years agoUpdate Travis to only use tox and coveralls on 3.5
Noah Morrison [Tue, 2 Oct 2018 19:54:49 +0000 (15:54 -0400)]
Update Travis to only use tox and coveralls on 3.5

7 years agoDeploy to PyPI from the source repo only
Akos Kiss [Tue, 2 Oct 2018 14:03:00 +0000 (16:03 +0200)]
Deploy to PyPI from the source repo only

Otherwise, Travis CI will try to deploy to (test)pypi for forks as
well, and it will fail.

7 years agoFix flake8-reported style issues
Akos Kiss [Mon, 1 Oct 2018 16:58:58 +0000 (18:58 +0200)]
Fix flake8-reported style issues

7 years agoFix nested loops
Noah Morrison [Sat, 29 Sep 2018 05:41:24 +0000 (01:41 -0400)]
Fix nested loops

This feels like it might still have edge cases, but it works for now.

7 years agoSupporting Partial File Without File Extension
Jon [Fri, 21 Sep 2018 05:04:48 +0000 (01:04 -0400)]
Supporting Partial File Without File Extension

Change made to function `_get_partial_ext`:
From `path = partials_path + '/' + name + '.' + partials_ext` to `path = partials_path + '/' + name + ('.' + partials_ext if partials_ext else '')`.

7 years agoUse more pythonic type checking
Guido Berhoerster [Tue, 28 Aug 2018 13:43:52 +0000 (15:43 +0200)]
Use more pythonic type checking

Use isinstance() and abstract base classes for checking available
functionality instead of strictly checking for base types. Among other
things, this allows for rendering any non-string sequences, iterators or
generators as lists (resolves #33) and for passing in any callable
instead of just plain functions.

7 years agoMerge branch 'master' of https://github.com/klorenz/chevron into klorenz-master
Noah Morrison [Fri, 24 Aug 2018 01:58:07 +0000 (21:58 -0400)]
Merge branch 'master' of https://github.com/klorenz/chevron into klorenz-master

7 years agoAllow for custom falsy data types
Noah Morrison [Fri, 24 Aug 2018 00:22:34 +0000 (20:22 -0400)]
Allow for custom falsy data types

Helps resolve Issue #35
This allows for a custom data type be outputed even when falsy

7 years agocache tokens for lambdas for speed
Kay-Uwe (Kiwi) Lorenz [Sun, 29 Jul 2018 06:02:57 +0000 (08:02 +0200)]
cache tokens for lambdas for speed

7 years agofix my flake issues
Kay-Uwe (Kiwi) Lorenz [Sat, 28 Jul 2018 07:15:50 +0000 (09:15 +0200)]
fix my flake issues

7 years agoupdate README
Kay-Uwe (Kiwi) Lorenz [Sat, 28 Jul 2018 07:01:17 +0000 (09:01 +0200)]
update README

7 years agoimplement #27 -- Lambdas
Kay-Uwe (Kiwi) Lorenz [Sat, 28 Jul 2018 06:36:06 +0000 (08:36 +0200)]
implement #27 -- Lambdas

7 years agoBump version (patch)
Noah Morrison [Sat, 21 Jul 2018 00:01:35 +0000 (20:01 -0400)]
Bump version (patch)

7 years agoRemove extra newline from cli
Noah Morrison [Fri, 20 Jul 2018 23:58:35 +0000 (19:58 -0400)]
Remove extra newline from cli

The render function already handles adding a newline