From: Daniel Morrison Date: Sun, 16 Nov 2014 04:02:24 +0000 (-0500) Subject: remove get() X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=5aca72221ac81d85d3149df7852b790e8d113226;p=chevron.git remove get() --- diff --git a/entei.py b/entei.py index e5afd4f..959e4e1 100755 --- a/entei.py +++ b/entei.py @@ -35,17 +35,6 @@ def tokenize(template): """Raised when you have unbalanced section tags""" pass - def get(amount=1): - """Reads amount of data from the template""" - - data = template.read(amount) - - # set the finish flag if there is not enough data left - if len(data) != amount: - template.is_finished = True - - return data - tag_types = { '!': 'comment', '#': 'section', @@ -107,12 +96,10 @@ def tokenize(template): # TODO: this is buggy # If we have a third curly brace - if get(1) == '}': + if template[0] == '}': # Then we are a no html escape tag + template[1:] tag_type = 'no escape' - else: - # Otherwise we need to give that character back - template.seek(template.tell() - 1) # If we might be a set delimiter tag elif tag_type == 'set delimiter?':