Skip to content

Commit

Permalink
Renamed from entei to chevron
Browse files Browse the repository at this point in the history
Possible future dialog

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

And I don't feel like dying :)
  • Loading branch information
noahmorrison committed Nov 18, 2014
1 parent 0a343df commit 42a028f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ A python implementation of the [mustache templating language](http://mustache.gi

Commandline usage:
```
./entei.py [data file] [template file]
./chevron.py [data file] [template file]
```

Python usage with strings
```
import entei
import chevron
entei.render('Hello, {{ mustache }}!', {'mustache': 'World'})
chevron.render('Hello, {{ mustache }}!', {'mustache': 'World'})
```

Python usage with file
```
import entei
import chevron
with open('file.mustache', 'r') as f:
entei.render(f, {'mustache': 'World'})
chevron.render(f, {'mustache': 'World'})
```

Python usage with unpacking
```
import entei
import chevron
args = {
template: 'Hello, {{ mustache }}!',
Expand All @@ -32,7 +32,7 @@ args = {
}
}
entei.render(**args)
chevron.render(**args)
```


Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import os
import json

import entei
import chevron

SPECS_PATH = os.path.join('spec', 'specs')
SPECS = [path for path in os.listdir(SPECS_PATH) if path.endswith('.json')]
STACHE = entei.render
STACHE = chevron.render


def _test_case_from_path(json_path):
Expand Down Expand Up @@ -60,15 +60,15 @@ def test_unclosed_sections(self):
'template': '{{# section }} end of file'
}

self.assertRaises(entei.UnclosedSection, entei.render, **test1)
self.assertRaises(entei.UnclosedSection, entei.render, **test2)
self.assertRaises(chevron.UnclosedSection, chevron.render, **test1)
self.assertRaises(chevron.UnclosedSection, chevron.render, **test2)

def test_unicode_basic(self):
args = {
'template': '(╯°□°)╯︵ ┻━┻'
}

result = entei.render(**args)
result = chevron.render(**args)
expected = '(╯°□°)╯︵ ┻━┻'

self.assertEqual(result, expected)
Expand All @@ -79,7 +79,7 @@ def test_unicode_variable(self):
'data': {'table_flip': '(╯°□°)╯︵ ┻━┻'}
}

result = entei.render(**args)
result = chevron.render(**args)
expected = '(╯°□°)╯︵ ┻━┻'

self.assertEqual(result, expected)
Expand All @@ -90,7 +90,7 @@ def test_unicode_partial(self):
'partials_dict': {'table_flip': '(╯°□°)╯︵ ┻━┻'}
}

result = entei.render(**args)
result = chevron.render(**args)
expected = '(╯°□°)╯︵ ┻━┻'

self.assertEqual(result, expected)
Expand All @@ -101,13 +101,13 @@ def test_listed_data(self):
'data': [1, 2, 3, 4, 5]
}

result = entei.render(**args)
result = chevron.render(**args)
expected = '(1)(2)(3)(4)(5)'

self.assertEqual(result, expected)

def test_main(self):
result = entei.main('tests/data.json', 'tests/test.mustache',
result = chevron.main('tests/data.json', 'tests/test.mustache',
partials_path='tests')

with open('tests/test.rendered', 'r') as f:
Expand Down

0 comments on commit 42a028f

Please sign in to comment.