summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-06 22:07:58 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-09 20:37:07 -0700
commit0fcc733cd4a36a3d195ebb78b04bb7412b126316 (patch)
treea127fceb6c4635261e376404eee9ae24dfc6b5a2 /sqlparse
parentdc52b32bc1e43155be22c1fa77eac0916bc35735 (diff)
downloadsqlparse-0fcc733cd4a36a3d195ebb78b04bb7412b126316.tar.gz
Add customizable newline
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/filters/aligned_indent.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sqlparse/filters/aligned_indent.py b/sqlparse/filters/aligned_indent.py
index 05539fa..ea749e9 100644
--- a/sqlparse/filters/aligned_indent.py
+++ b/sqlparse/filters/aligned_indent.py
@@ -21,7 +21,8 @@ class AlignedIndentFilter(object):
'ORDER', 'UNION', 'VALUES',
'SET', 'BETWEEN', 'EXCEPT')
- def __init__(self, char=' ', line_width=None):
+ def __init__(self, char=' ', n='\n'):
+ self.n = n
self.offset = 0
self.indent = 0
self.char = char
@@ -33,7 +34,7 @@ class AlignedIndentFilter(object):
# add two for the space and parens
indent = self.indent * (2 + self._max_kwd_len)
- return sql.Token(T.Whitespace, '\n' + self.char * (
+ return sql.Token(T.Whitespace, self.n + self.char * (
self._max_kwd_len + offset + indent + self.offset))
def _process_statement(self, tlist):