]> Devi Nivas Git - chevron.git/log
chevron.git
11 years agoMerge branch 'tox' of git://github.com/msabramo/chevron into msabramo-tox
noah morrison [Sun, 25 Jan 2015 04:14:42 +0000 (23:14 -0500)]
Merge branch 'tox' of git://github.com/msabramo/chevron into msabramo-tox

11 years agoBump version
noah morrison [Sun, 25 Jan 2015 04:11:01 +0000 (23:11 -0500)]
Bump version

11 years agoMerge branch 'pypi-cleanup'
noah morrison [Sun, 25 Jan 2015 04:06:40 +0000 (23:06 -0500)]
Merge branch 'pypi-cleanup'

Closes #10 - add pypi badge to README.md
Closes #11 - convert README.md to rst for pypi
Closes #12 [PR] - Fixed with commit 108af743de73a4d7fc4358720b63d62f60227cd6

11 years agoMake setup.py more readable.
noah morrison [Sun, 25 Jan 2015 03:59:47 +0000 (22:59 -0500)]
Make setup.py more readable.

11 years agoConvert README.md to rst for pypi using pandoc.
noah morrison [Sun, 25 Jan 2015 03:58:07 +0000 (22:58 -0500)]
Convert README.md to rst for pypi using pandoc.

Closes #11

Thanks for the tips/help Marc :)

11 years agoAdd tox.ini for tox (http://tox.testrun.org/)
Marc Abramowitz [Fri, 23 Jan 2015 15:44:42 +0000 (07:44 -0800)]
Add tox.ini for tox (http://tox.testrun.org/)

11 years agoAdd pypi version badge to README.
noah morrison [Fri, 23 Jan 2015 13:40:54 +0000 (08:40 -0500)]
Add pypi version badge to README.

closes #10

11 years agoFix url for pypi.
noah morrison [Fri, 23 Jan 2015 13:32:34 +0000 (08:32 -0500)]
Fix url for pypi.

Don't ask how this happened... I don't want to talk about it.

11 years agoAdd setup.py.
noah morrison [Fri, 23 Jan 2015 04:44:09 +0000 (23:44 -0500)]
Add setup.py.

Suggested/wanted by msabramo on github.

closes #6

11 years agoFix unicode inside of lists for python 2
noah morrison [Fri, 23 Jan 2015 02:59:10 +0000 (21:59 -0500)]
Fix unicode inside of lists for python 2

11 years agoAdd unittest for unicode inside of lists.
noah morrison [Fri, 23 Jan 2015 02:58:37 +0000 (21:58 -0500)]
Add unittest for unicode inside of lists.

This currently breaks python 2

11 years agoTokens needs to be a generator, not a list.
noah morrison [Fri, 16 Jan 2015 15:52:47 +0000 (10:52 -0500)]
Tokens needs to be a generator, not a list.

At first I thought they were pretty much the same thing.
But generators pick up from where they left off,
while lists don't.

This fixes the edge-case infinite loop
that was happening last commit.

from the python repl

Lists
>>> data = [1,2,3,4,5]
>>> for i in data:
...     print(i)
...     if i == 2:
...         for ii in data:
...             print('>', ii)
...             if ii == 4:
...                 break
...
1
2
> 1
> 2
> 3
> 4
3
4
5

Generators
>>> data = [1,2,3,4,5]
>>> gen = (d for d in data)
>>> for i in gen:
...     print(i)
...     if i == 2:
...         for ii in gen:
...             print('>', ii)
...             if ii == 4:
...                 break
...
1
2
> 3
> 4
5

11 years agoAdd a unittest for an edge-case recursion error.
noah morrison [Fri, 16 Jan 2015 15:51:20 +0000 (10:51 -0500)]
Add a unittest for an edge-case recursion error.

Currently this makes chevron run in an infinite loop
(Until recursion depth limit happens)

11 years agoFixed _get_key returning prematurely
noah morrison [Thu, 15 Jan 2015 20:02:41 +0000 (15:02 -0500)]
Fixed _get_key returning prematurely

Variables were clobbering other variables... badness was happening.

When given
```test.ms
{{# container }}
  {{ sibbling.child }}
{{/ container }}
```

```test.json
{
    "container": [1,2,3],
    "sibbling": {
        "child": "Just me."
    }
}
```

it was returning
```wrong.txt
  {'child': 'Just me.'}
  {'child': 'Just me.'}
  {'child': 'Just me.'}
```

when it should have returned
```right.txt
  Just me.
  Just me.
  Just me.
```

11 years agoSplit tokenizer up into helper functions
noah morrison [Tue, 23 Dec 2014 03:57:23 +0000 (22:57 -0500)]
Split tokenizer up into helper functions

In an attempt to make it more readable, and seperate parsing
logic from tokenizing logic.

11 years agoClean up the tokenizer a bit
noah morrison [Fri, 5 Dec 2014 04:07:09 +0000 (23:07 -0500)]
Clean up the tokenizer a bit

11 years agoMerge branch 'cleanup-renderer'
noah morrison [Sat, 29 Nov 2014 22:25:51 +0000 (17:25 -0500)]
Merge branch 'cleanup-renderer'

11 years agoFix python 2 encoding problem with the new docstr
noah morrison [Sat, 29 Nov 2014 22:24:06 +0000 (17:24 -0500)]
Fix python 2 encoding problem with the new docstr

Python 2 did not like my fancy new doc string with the unicode
filetree

11 years agoUpdate the render doc string
noah morrison [Sat, 29 Nov 2014 22:17:16 +0000 (17:17 -0500)]
Update the render doc string

11 years agoMove get_partial out of render
noah morrison [Sat, 29 Nov 2014 21:40:07 +0000 (16:40 -0500)]
Move get_partial out of render

Also "hid" it (Put an underscore in front of it)

11 years agoMove get_key out of render
noah morrison [Sat, 29 Nov 2014 21:37:51 +0000 (16:37 -0500)]
Move get_key out of render

Also "hid" it (Put an underscore in front of it)

11 years agoMove html_escape out of render
noah morrison [Sat, 29 Nov 2014 21:34:38 +0000 (16:34 -0500)]
Move html_escape out of render

Also "hid" it (Put an underscore in front of it)

11 years agoUpdated the readme
noah morrison [Fri, 28 Nov 2014 15:09:12 +0000 (10:09 -0500)]
Updated the readme

11 years agoAdded syntax highlighting for python code
Noah Morrison [Thu, 27 Nov 2014 21:46:18 +0000 (16:46 -0500)]
Added syntax highlighting for python code

11 years agoMerge branch 'rebase'
noah morrison [Sat, 22 Nov 2014 23:24:14 +0000 (18:24 -0500)]
Merge branch 'rebase'

Seperate the functions into seperate files and remove custom exception

11 years agoRemoved custom exception in favor of a builtin
noah morrison [Sat, 22 Nov 2014 23:18:17 +0000 (18:18 -0500)]
Removed custom exception in favor of a builtin

11 years agoFixed imports (please help)
noah morrison [Sat, 22 Nov 2014 23:16:47 +0000 (18:16 -0500)]
Fixed imports (please help)

This is terrible... I hate it... there must be a better way...

11 years agoRenamed chevron.py to main.py
noah morrison [Sat, 22 Nov 2014 18:49:27 +0000 (13:49 -0500)]
Renamed chevron.py to main.py

and updated the chevron/__init__.py

11 years agoMove render into it's own file
noah morrison [Sat, 22 Nov 2014 18:33:20 +0000 (13:33 -0500)]
Move render into it's own file

11 years agoMove tokenize into it's own file
noah morrison [Sat, 22 Nov 2014 18:27:09 +0000 (13:27 -0500)]
Move tokenize into it's own file

11 years agoFixed cli default arguments
noah morrison [Sat, 22 Nov 2014 02:08:27 +0000 (21:08 -0500)]
Fixed cli default arguments

And it's so much prettier

11 years agoRaised coverage to 100%
noah morrison [Fri, 21 Nov 2014 03:31:14 +0000 (22:31 -0500)]
Raised coverage to 100%

Kind of an lazy/evil way to do it, but I don't feel like writing
a unittest for calling main with no data.

11 years agoAdd the ability to change the default delimiters
noah morrison [Fri, 21 Nov 2014 03:26:36 +0000 (22:26 -0500)]
Add the ability to change the default delimiters

This is not the same as adding
{{=<< >>=}}
to the top of the file as the default delimiters will persist
through partials while changing the delimiters will not.

11 years agoMerge pull request #5 from dmorrison42/patch-1
Noah Morrison [Wed, 19 Nov 2014 17:30:32 +0000 (12:30 -0500)]
Merge pull request #5 from dmorrison42/patch-1

Fix headings

11 years agoFix headings
Daniel Morrison [Wed, 19 Nov 2014 11:59:30 +0000 (06:59 -0500)]
Fix headings

Bulleted lists don't look as strong as intentional headings.

11 years agoAdded nicer cli using argparse
noah morrison [Wed, 19 Nov 2014 04:43:36 +0000 (23:43 -0500)]
Added nicer cli using argparse

11 years agoUpdated main function to not need data file
noah morrison [Wed, 19 Nov 2014 04:42:41 +0000 (23:42 -0500)]
Updated main function to not need data file

If no data file is present it defaults to an empty dictionary

11 years agoAdded coverage badge to README.md
Noah Morrison [Wed, 19 Nov 2014 04:06:12 +0000 (23:06 -0500)]
Added coverage badge to README.md

11 years agofixed travis not calling coveralls
noah morrison [Wed, 19 Nov 2014 04:01:24 +0000 (23:01 -0500)]
fixed travis not calling coveralls

/facepalm

11 years agoFix python 2.6 failing
noah morrison [Wed, 19 Nov 2014 03:42:19 +0000 (22:42 -0500)]
Fix python 2.6 failing

Thanks travis!

11 years agoAdded coveralls to travis
noah morrison [Wed, 19 Nov 2014 03:33:05 +0000 (22:33 -0500)]
Added coveralls to travis

11 years agoFixed README.md error
noah morrison [Wed, 19 Nov 2014 03:16:35 +0000 (22:16 -0500)]
Fixed README.md error

above, below... same thing right?

11 years agoUpdated the README.md
noah morrison [Wed, 19 Nov 2014 02:16:49 +0000 (21:16 -0500)]
Updated the README.md

11 years agoRemove setup.py from git
noah morrison [Tue, 18 Nov 2014 23:13:14 +0000 (18:13 -0500)]
Remove setup.py from git

11 years agoUpdated README.md to have travis-ci build sticker
noah morrison [Tue, 18 Nov 2014 22:21:43 +0000 (17:21 -0500)]
Updated README.md to have travis-ci build sticker

11 years agoAdd .travis.yml
noah morrison [Tue, 18 Nov 2014 22:11:29 +0000 (17:11 -0500)]
Add .travis.yml

for http://travis-ci.org

11 years agoPrefer setuptools to distutils.core
noah morrison [Tue, 18 Nov 2014 22:05:34 +0000 (17:05 -0500)]
Prefer setuptools to distutils.core

11 years agopep8
noah morrison [Tue, 18 Nov 2014 21:51:49 +0000 (16:51 -0500)]
pep8

11 years agoAdded cli_main to coveragerc exclude
noah morrison [Tue, 18 Nov 2014 21:49:44 +0000 (16:49 -0500)]
Added cli_main to coveragerc exclude

11 years agoMerge branch 'distribute'
noah morrison [Tue, 18 Nov 2014 21:43:34 +0000 (16:43 -0500)]
Merge branch 'distribute'

Made chevron much easier to install and use

11 years agoAdded setup.py for pip installs
noah morrison [Tue, 18 Nov 2014 21:40:01 +0000 (16:40 -0500)]
Added setup.py for pip installs

11 years agoAdded __init__.py and started using relative paths
noah morrison [Tue, 18 Nov 2014 21:38:12 +0000 (16:38 -0500)]
Added __init__.py and started using relative paths

11 years agoAdded __init__.py to chevron/
noah morrison [Tue, 18 Nov 2014 21:20:47 +0000 (16:20 -0500)]
Added __init__.py to chevron/

11 years agoStarted pip-ability
noah morrison [Tue, 18 Nov 2014 21:08:05 +0000 (16:08 -0500)]
Started pip-ability

Moved chevron.py to chevron/

Added cli_main function that is now called on __main__
  (because __main__ is not callable from pip)

Print usage when not given enough arguments

11 years agoAdded a benchmark
noah morrison [Tue, 18 Nov 2014 18:13:22 +0000 (13:13 -0500)]
Added a benchmark

currently running
    ./benchmark
will return around 1.3631531159917358

11 years agopep8
noah morrison [Tue, 18 Nov 2014 17:32:31 +0000 (12:32 -0500)]
pep8

11 years agoIgnore python 2 specific areas in coverage
noah morrison [Tue, 18 Nov 2014 17:30:44 +0000 (12:30 -0500)]
Ignore python 2 specific areas in coverage

coverage now ignores any lines with
    # python 2
in them.

11 years agoMerge pull request #4 from dmorrison42/Pythonv3.2.2
Noah Morrison [Tue, 18 Nov 2014 04:25:36 +0000 (23:25 -0500)]
Merge pull request #4 from dmorrison42/Pythonv3.2.2

Cause Python version 3.2.2 not to die.

11 years agoCause Python version 3.2.2 not to die.
Daniel Morrison [Tue, 18 Nov 2014 04:22:41 +0000 (23:22 -0500)]
Cause Python version 3.2.2 not to die.

Python 3.2.2 thinks that '~' is not '~'.
Simple solution !=

11 years agoMerge pull request #3 from dmorrison42/unicode
Noah Morrison [Tue, 18 Nov 2014 04:20:03 +0000 (23:20 -0500)]
Merge pull request #3 from dmorrison42/unicode

Speed up unicode support.

11 years agoSpeed up unicode support.
Daniel Morrison [Tue, 18 Nov 2014 04:13:53 +0000 (23:13 -0500)]
Speed up unicode support.

- Remove uneeded import
- Remove uneeded if statement

11 years agoRenamed from entei to chevron
noah morrison [Tue, 18 Nov 2014 03:22:13 +0000 (22:22 -0500)]
Renamed from entei to chevron

Possible future dialog

    nintendo uses legal battle
    ... It's very effective

And I don't feel like dying :)

11 years agoUpdated TODO in README
noah morrison [Tue, 18 Nov 2014 03:11:47 +0000 (22:11 -0500)]
Updated TODO in README

11 years agoFixed listed data
noah morrison [Tue, 18 Nov 2014 03:07:18 +0000 (22:07 -0500)]
Fixed listed data

render now takes a scopes argument, instead of having data and scopes
mushed together in one big unhappy family.

11 years agoAdded unittest for listed data
noah morrison [Tue, 18 Nov 2014 03:06:59 +0000 (22:06 -0500)]
Added unittest for listed data

11 years agoMerge branch 'unicode'
noah morrison [Tue, 18 Nov 2014 02:42:43 +0000 (21:42 -0500)]
Merge branch 'unicode'

This slows it down a tad :(

11 years agopython 3 working
noah morrison [Tue, 18 Nov 2014 02:33:17 +0000 (21:33 -0500)]
python 3 working

11 years agopython 2 working
noah morrison [Tue, 18 Nov 2014 02:17:12 +0000 (21:17 -0500)]
python 2 working

11 years agoAdded unicode to test.mustache
noah morrison [Tue, 18 Nov 2014 00:10:21 +0000 (19:10 -0500)]
Added unicode to test.mustache

11 years agoAdded unicode unittests
noah morrison [Mon, 17 Nov 2014 23:57:01 +0000 (18:57 -0500)]
Added unicode unittests

11 years agopep8
noah morrison [Mon, 17 Nov 2014 23:56:50 +0000 (18:56 -0500)]
pep8

11 years agoMoved test files to tests/
noah morrison [Mon, 17 Nov 2014 20:13:55 +0000 (15:13 -0500)]
Moved test files to tests/

11 years agoMerge remote-tracking branch 'standalones'
noah morrison [Mon, 17 Nov 2014 19:30:13 +0000 (14:30 -0500)]
Merge remote-tracking branch 'standalones'

from dmorrison42/standalones

Much simpler logic and removes some code that I didn't understand

11 years agoSimplify standalone code.
Daniel Morrison [Sun, 16 Nov 2014 21:04:57 +0000 (16:04 -0500)]
Simplify standalone code.

- Only split once
- Don't join what is already there
- Clarify logic

11 years agoExpanded unittest coverage to 100%
noah morrison [Sun, 16 Nov 2014 20:31:50 +0000 (15:31 -0500)]
Expanded unittest coverage to 100%

Using https://pypi.python.org/pypi/coverage

11 years agoMerge remote-tracking branch 'filetostring'
noah morrison [Sun, 16 Nov 2014 19:32:52 +0000 (14:32 -0500)]
Merge remote-tracking branch 'filetostring'

from dmorrison42/filetostring

Huge speed increase, and makes the code much easier to read.

11 years agoRemove unused code.
Daniel Morrison [Sun, 16 Nov 2014 13:35:43 +0000 (08:35 -0500)]
Remove unused code.

None of this code was hit under the unittest.
Hopefully obsolete.

11 years agoOnly define UnclosedSection once.
Daniel Morrison [Sun, 16 Nov 2014 06:02:03 +0000 (01:02 -0500)]
Only define UnclosedSection once.

If you define things in a loop it slows down. Go figure.

    42% speedup.

11 years agoImprove newline handling for standalone's.
Daniel Morrison [Sun, 16 Nov 2014 05:43:49 +0000 (00:43 -0500)]
Improve newline handling for standalone's.

Fixes bug in benchmark. No I’m still not sure I understand.

11 years agoFaster html_escape
Daniel Morrison [Sun, 16 Nov 2014 05:28:21 +0000 (00:28 -0500)]
Faster html_escape

- uses string specific speedups
- requires & be handled first
- 33.7% overall speedup… we need this

11 years agoHandle no newline after standalone.
Daniel Morrison [Sun, 16 Nov 2014 05:26:16 +0000 (00:26 -0500)]
Handle no newline after standalone.

11 years agoFix bugginess of {{{}}} style no escape.
Daniel Morrison [Sun, 16 Nov 2014 05:24:24 +0000 (00:24 -0500)]
Fix bugginess of {{{}}} style no escape.

- Checks to ensure delimiters are set correctly.
- Actually remove the }

11 years agoSpecial handling for 'set delimiter?'
Daniel Morrison [Sun, 16 Nov 2014 05:19:15 +0000 (00:19 -0500)]
Special handling for 'set delimiter?'

I don’t understand why, but this helps unit tests pass.

11 years agommap does not actually work like that.
Daniel Morrison [Sun, 16 Nov 2014 05:17:14 +0000 (00:17 -0500)]
mmap does not actually work like that.

- Remove mmap
- Just load the entire file into memory (should be fine)

11 years agoFixed end of file errors.
Daniel Morrison [Sun, 16 Nov 2014 04:10:28 +0000 (23:10 -0500)]
Fixed end of file errors.

11 years agoMore is finished stuff.
Daniel Morrison [Sun, 16 Nov 2014 04:08:39 +0000 (23:08 -0500)]
More is finished stuff.

11 years agoRemove is_finished
Daniel Morrison [Sun, 16 Nov 2014 04:04:57 +0000 (23:04 -0500)]
Remove is_finished

11 years agoremove get()
Daniel Morrison [Sun, 16 Nov 2014 04:02:24 +0000 (23:02 -0500)]
remove get()

11 years agoRemove grab_literal
Daniel Morrison [Sun, 16 Nov 2014 04:00:22 +0000 (23:00 -0500)]
Remove grab_literal

11 years agoChange file-like objects to strings.
Daniel Morrison [Sun, 16 Nov 2014 03:51:52 +0000 (22:51 -0500)]
Change file-like objects to strings.

11 years agoAdded inline comments
noah morrison [Sat, 15 Nov 2014 04:19:52 +0000 (23:19 -0500)]
Added inline comments

And updated the render doc comment

11 years agoMake the unknown tag message more apparent
noah morrison [Sat, 15 Nov 2014 04:16:56 +0000 (23:16 -0500)]
Make the unknown tag message more apparent

Maybe this should throw an exception even

11 years agoUse endswith instead of splicing
noah morrison [Sat, 15 Nov 2014 03:38:46 +0000 (22:38 -0500)]
Use endswith instead of splicing

11 years agoMove the last literal yield up higher
noah morrison [Sat, 15 Nov 2014 03:23:45 +0000 (22:23 -0500)]
Move the last literal yield up higher

Moved it above the standalone checking

11 years agoUse endswith instead of splicing
noah morrison [Sat, 15 Nov 2014 03:02:14 +0000 (22:02 -0500)]
Use endswith instead of splicing

11 years agoUpdated README
noah morrison [Wed, 12 Nov 2014 15:12:40 +0000 (10:12 -0500)]
Updated README

11 years agoAdded complete unpacking ability to render
noah morrison [Wed, 12 Nov 2014 15:11:43 +0000 (10:11 -0500)]
Added complete unpacking ability to render

All of renders args are now KWargs

11 years agoUpdated test.mustache and data.json
noah morrison [Wed, 12 Nov 2014 14:51:36 +0000 (09:51 -0500)]
Updated test.mustache and data.json

11 years agoFixed variables being registered as standalones
noah morrison [Wed, 12 Nov 2014 14:49:29 +0000 (09:49 -0500)]
Fixed variables being registered as standalones

I was never setting is_standalone to false if the tag
was a variable or a no html escape tag

11 years agoRemoved unneeded if statement
noah morrison [Wed, 12 Nov 2014 14:30:46 +0000 (09:30 -0500)]
Removed unneeded if statement