From a6d6641e5feb0507f08d9167158d4ca033eb940f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s=20Combarro=20=22Piranna=22?= Date: Fri, 18 May 2012 22:41:01 +0200 Subject: Added comments and documentation to _get_offset() --- sqlparse/filters.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sqlparse') diff --git a/sqlparse/filters.py b/sqlparse/filters.py index 006bccc..a6a34e9 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -274,6 +274,10 @@ class ReindentFilter: self._last_stmt = None def _get_offset(self, token): + """ + Return the offset where the token should be indented + """ + # Get last processed line (the current one) up to the next token all_ = list(self._curr_stmt.flatten()) idx = all_.index(token) raw = ''.join(unicode(x) for x in all_[:idx + 1]) -- cgit v1.2.1