diff options
| author | Jesús Leganés Combarro "Piranna" <piranna@gmail.com> | 2012-05-18 22:41:01 +0200 |
|---|---|---|
| committer | Jesús Leganés Combarro "Piranna" <piranna@gmail.com> | 2012-05-18 22:41:01 +0200 |
| commit | a6d6641e5feb0507f08d9167158d4ca033eb940f (patch) | |
| tree | b30a64288f9924b2dfb4badb332722e71258cc4f /sqlparse | |
| parent | 980a9b70c32da9863af6ca9600cce9a5142ad60f (diff) | |
| download | sqlparse-a6d6641e5feb0507f08d9167158d4ca033eb940f.tar.gz | |
Added comments and documentation to _get_offset()
Diffstat (limited to 'sqlparse')
| -rw-r--r-- | sqlparse/filters.py | 4 |
1 files changed, 4 insertions, 0 deletions
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]) |
