]>
Devi Nivas Git - chevron.git/log
noah morrison [Wed, 19 Nov 2014 03:42:19 +0000 (22:42 -0500)]
Fix python 2.6 failing
Thanks travis!
noah morrison [Wed, 19 Nov 2014 03:33:05 +0000 (22:33 -0500)]
Added coveralls to travis
noah morrison [Wed, 19 Nov 2014 03:16:35 +0000 (22:16 -0500)]
Fixed README.md error
above, below... same thing right?
noah morrison [Wed, 19 Nov 2014 02:16:49 +0000 (21:16 -0500)]
Updated the README.md
noah morrison [Tue, 18 Nov 2014 23:13:14 +0000 (18:13 -0500)]
Remove setup.py from git
noah morrison [Tue, 18 Nov 2014 22:21:43 +0000 (17:21 -0500)]
Updated README.md to have travis-ci build sticker
noah morrison [Tue, 18 Nov 2014 22:11:29 +0000 (17:11 -0500)]
Add .travis.yml
for http://travis-ci.org
noah morrison [Tue, 18 Nov 2014 22:05:34 +0000 (17:05 -0500)]
Prefer setuptools to distutils.core
noah morrison [Tue, 18 Nov 2014 21:51:49 +0000 (16:51 -0500)]
pep8
noah morrison [Tue, 18 Nov 2014 21:49:44 +0000 (16:49 -0500)]
Added cli_main to coveragerc exclude
noah morrison [Tue, 18 Nov 2014 21:43:34 +0000 (16:43 -0500)]
Merge branch 'distribute'
Made chevron much easier to install and use
noah morrison [Tue, 18 Nov 2014 21:40:01 +0000 (16:40 -0500)]
Added setup.py for pip installs
noah morrison [Tue, 18 Nov 2014 21:38:12 +0000 (16:38 -0500)]
Added __init__.py and started using relative paths
noah morrison [Tue, 18 Nov 2014 21:20:47 +0000 (16:20 -0500)]
Added __init__.py to chevron/
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
noah morrison [Tue, 18 Nov 2014 18:13:22 +0000 (13:13 -0500)]
Added a benchmark
currently running
./benchmark
will return around 1.
3631531159917358
noah morrison [Tue, 18 Nov 2014 17:32:31 +0000 (12:32 -0500)]
pep8
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.
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.
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 !=
Noah Morrison [Tue, 18 Nov 2014 04:20:03 +0000 (23:20 -0500)]
Merge pull request #3 from dmorrison42/unicode
Speed 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
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 :)
noah morrison [Tue, 18 Nov 2014 03:11:47 +0000 (22:11 -0500)]
Updated TODO in README
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.
noah morrison [Tue, 18 Nov 2014 03:06:59 +0000 (22:06 -0500)]
Added unittest for listed data
noah morrison [Tue, 18 Nov 2014 02:42:43 +0000 (21:42 -0500)]
Merge branch 'unicode'
This slows it down a tad :(
noah morrison [Tue, 18 Nov 2014 02:33:17 +0000 (21:33 -0500)]
python 3 working
noah morrison [Tue, 18 Nov 2014 02:17:12 +0000 (21:17 -0500)]
python 2 working
noah morrison [Tue, 18 Nov 2014 00:10:21 +0000 (19:10 -0500)]
Added unicode to test.mustache
noah morrison [Mon, 17 Nov 2014 23:57:01 +0000 (18:57 -0500)]
Added unicode unittests
noah morrison [Mon, 17 Nov 2014 23:56:50 +0000 (18:56 -0500)]
pep8
noah morrison [Mon, 17 Nov 2014 20:13:55 +0000 (15:13 -0500)]
Moved test files to tests/
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
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
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
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.
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.
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.
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.
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
Daniel Morrison [Sun, 16 Nov 2014 05:26:16 +0000 (00:26 -0500)]
Handle no newline after standalone.
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 }
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.
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)
Daniel Morrison [Sun, 16 Nov 2014 04:10:28 +0000 (23:10 -0500)]
Fixed end of file errors.
Daniel Morrison [Sun, 16 Nov 2014 04:08:39 +0000 (23:08 -0500)]
More is finished stuff.
Daniel Morrison [Sun, 16 Nov 2014 04:04:57 +0000 (23:04 -0500)]
Remove is_finished
Daniel Morrison [Sun, 16 Nov 2014 04:02:24 +0000 (23:02 -0500)]
remove get()
Daniel Morrison [Sun, 16 Nov 2014 04:00:22 +0000 (23:00 -0500)]
Remove grab_literal
Daniel Morrison [Sun, 16 Nov 2014 03:51:52 +0000 (22:51 -0500)]
Change file-like objects to strings.
noah morrison [Sat, 15 Nov 2014 04:19:52 +0000 (23:19 -0500)]
Added inline comments
And updated the render doc comment
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
noah morrison [Sat, 15 Nov 2014 03:38:46 +0000 (22:38 -0500)]
Use endswith instead of splicing
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
noah morrison [Sat, 15 Nov 2014 03:02:14 +0000 (22:02 -0500)]
Use endswith instead of splicing
noah morrison [Wed, 12 Nov 2014 15:12:40 +0000 (10:12 -0500)]
Updated README
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
noah morrison [Wed, 12 Nov 2014 14:51:36 +0000 (09:51 -0500)]
Updated test.mustache and data.json
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
noah morrison [Wed, 12 Nov 2014 14:30:46 +0000 (09:30 -0500)]
Removed unneeded if statement
noah morrison [Wed, 12 Nov 2014 02:44:22 +0000 (21:44 -0500)]
Fixed partial standalones
Partial standalone tags do not have the whitespace stripped from them
noah morrison [Wed, 12 Nov 2014 02:36:06 +0000 (21:36 -0500)]
Added partial padding
Partials now can be indented in a silly manner based on the spec
(the silly manner being variables inside the partial have a
god given ability to reset the indentation)
noah morrison [Tue, 11 Nov 2014 03:17:00 +0000 (22:17 -0500)]
Fixed set delimiter tags nomming a character
noah morrison [Tue, 11 Nov 2014 02:15:10 +0000 (21:15 -0500)]
pep8
oops....
Daniel Morrison [Tue, 11 Nov 2014 01:33:21 +0000 (20:33 -0500)]
Fix standalones failing to register.
noah morrison [Tue, 11 Nov 2014 01:32:46 +0000 (20:32 -0500)]
Fixed random character nomming
noah morrison [Tue, 11 Nov 2014 01:01:30 +0000 (20:01 -0500)]
Fixed falsy scopes exiting prematurely
noah morrison [Tue, 11 Nov 2014 00:50:13 +0000 (19:50 -0500)]
Added current scope key (.)
noah morrison [Tue, 11 Nov 2014 00:49:11 +0000 (19:49 -0500)]
Fixed partial scoping
partials would not get their parent's partial detials
(partials_path, partials_ext, partials_dict)
noah morrison [Tue, 11 Nov 2014 00:48:08 +0000 (19:48 -0500)]
Added section looping
( note: not implemented on inverted sections! )
Daniel Morrison [Mon, 10 Nov 2014 03:48:01 +0000 (22:48 -0500)]
Make unittests easier to deal with.
- Test everything
./test_spec.py
- Test suite
./test_spec.py inverted
- Test unit
./test_spec.py inverted.test_7
noah morrison [Mon, 10 Nov 2014 03:12:02 +0000 (22:12 -0500)]
Fixed html escaping on double quotes
I am an moron
noah morrison [Mon, 10 Nov 2014 03:11:04 +0000 (22:11 -0500)]
Fixed variables being standalones
noah morrison [Sun, 9 Nov 2014 01:19:24 +0000 (20:19 -0500)]
Began fixing standalones
* stopped closing the file, instead use a variable
so I can reach the end of the file and seek back
* moved literal yielding to the end of the tokenize function
so I can remove whitespace from it if it's before a standalone
* stopped set_delimiter? from continuing the while loop
so I can handle the standalone
* added standalone handling, which checks the left and the right
parts of every tag to see if it's all alone on a line. And if so
it will edit the whitespace in the literals
noah morrison [Sat, 8 Nov 2014 03:00:38 +0000 (22:00 -0500)]
Fixed IndexError on scopes
If there are no scopes it defaults to None
noah morrison [Sat, 8 Nov 2014 02:59:08 +0000 (21:59 -0500)]
get_key now defaults to ''
Instead of return None, get_key now returns an empty string.
Also wrapped get_key calls in str
noah morrison [Sat, 8 Nov 2014 02:56:27 +0000 (21:56 -0500)]
Fixed get_partial raising an error
get_partial would throw an error when no partial was found.
Now it just returns an empty StringIO (and thus an empty partial).
noah morrison [Thu, 6 Nov 2014 22:25:05 +0000 (17:25 -0500)]
Added support for delimiters to be any size
Instead of needing them to be 2 characters.
Also ignores all spaces in the center (instead of expecting one).
And fixed a bug where delimiters would eat some trailing characters!
noah morrison [Thu, 6 Nov 2014 22:23:07 +0000 (17:23 -0500)]
Added the parameter partials_dict to render
partials_dict will be searched before the filesystem is.
It is an easy way to only use strings and not need the filesystem.
noah morrison [Thu, 6 Nov 2014 22:16:10 +0000 (17:16 -0500)]
Updated unittests to deal with partials.
noah morrison [Thu, 6 Nov 2014 20:34:32 +0000 (15:34 -0500)]
Fixed python 2 StringIO bug
In python 2 strings were not being converted to StringIOs.
The new method assumes that template is a string and tries to convert
it to a StringIO. If that fails then it assumes a file-like object.
noah morrison [Thu, 6 Nov 2014 20:25:14 +0000 (15:25 -0500)]
Fixed whitespace stripping
In the last commit I changed how tag_key was being grabbed.
This broke the way that I was stripping the whitespace.
(whitespace from the front was staying)
noah morrison [Thu, 6 Nov 2014 02:47:05 +0000 (21:47 -0500)]
Removed peek
Peek had a lot of file-object calls that were not needed,
and was an easy removal.
noah morrison [Wed, 5 Nov 2014 02:30:36 +0000 (21:30 -0500)]
Removed cgi import
Made my own html escape function to replace the cgi import.
Also updated the test.mustache and data.json files to have an
escaped string get printed.
noah morrison [Mon, 3 Nov 2014 22:00:48 +0000 (17:00 -0500)]
Removed the 3 from the readme
As far as I'm aware this project works on python2 and python3.
If this is not true it is a bug.
noah morrison [Mon, 3 Nov 2014 21:57:20 +0000 (16:57 -0500)]
Rename project to entei
noah morrison [Mon, 3 Nov 2014 21:40:48 +0000 (16:40 -0500)]
Fixed the bug from last night.
Removed some leftover code from testing that messed things up.
noah morrison [Mon, 3 Nov 2014 04:43:51 +0000 (23:43 -0500)]
Added some documentation
And fixed some pep8 problems.
also... the code seems to not be rendering right...
how long has that been happening?
noah morrison [Sat, 1 Nov 2014 20:33:14 +0000 (16:33 -0400)]
Made unit tests more descriptive
noah morrison [Sat, 1 Nov 2014 20:30:28 +0000 (16:30 -0400)]
Fixed Indented Multiline Standalone failure
* Handle empty data
* Close file instead of EOFError
* Yield final literal
noah morrison [Sat, 1 Nov 2014 19:43:19 +0000 (15:43 -0400)]
Added unit tests
noah morrison [Sat, 1 Nov 2014 19:24:53 +0000 (15:24 -0400)]
Updated the README
noah morrison [Sat, 1 Nov 2014 19:20:45 +0000 (15:20 -0400)]
Added a render function
Render takes a template and data dictionary and returns
a mustache rendered string.
Also updated the test.mustache and added a partial.mustache file.
noah morrison [Sat, 1 Nov 2014 19:18:53 +0000 (15:18 -0400)]
Stopped tokenize from yielding comment tags
noah morrison [Sat, 1 Nov 2014 17:23:51 +0000 (13:23 -0400)]
Fixed "no escape?" bug
Triple brace tags were yielding "no escape?" instead of "no escape".
noah morrison [Sat, 1 Nov 2014 16:50:26 +0000 (12:50 -0400)]
DRY'd the code some
Added a function to grab literals and tag keys,
since the code was very similar and in two places.
Also the grab_literal function is probably more efficent,
as it doesn't peek so much.
noah morrison [Sat, 1 Nov 2014 16:49:53 +0000 (12:49 -0400)]
Added some documentation
Documented the tokenize function.
noah morrison [Fri, 31 Oct 2014 20:42:03 +0000 (16:42 -0400)]
Updated README
noah morrison [Fri, 31 Oct 2014 20:36:57 +0000 (16:36 -0400)]
Changed tokenize to use file like objects
tokenize now takes a file object (or file like object).
If tokenize is given a string it turns it into a file like object.
Also renamed look to peek.