From: Oleg Broytman Date: Sat, 10 Sep 2016 17:05:22 +0000 (+0300) Subject: Rename remove_directives -> remove_directive_tokens X-Git-Tag: 0.0.6~28 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=bc473dfbbebeea2e2f4e0f368408632e047949ac;p=sqlconvert.git Rename remove_directives -> remove_directive_tokens --- diff --git a/ChangeLog b/ChangeLog index 597b210..6d0e194 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Version 0.0.6 (2016-09-??) Condense a sequence of newlines after a /*! directive */; + Rename remove_directives -> remove_directive_tokens. + Version 0.0.5 (2016-09-07) Remove /*! directives */; and newlines after them. diff --git a/sqlconvert/process_mysql.py b/sqlconvert/process_mysql.py index 3f2f6aa..f91f516 100644 --- a/sqlconvert/process_mysql.py +++ b/sqlconvert/process_mysql.py @@ -26,7 +26,7 @@ def is_directive_statement(statement): return True -def remove_directives(statement): +def remove_directive_tokens(statement): """Remove /*! directives */ from the first-level""" new_tokens = [] for token in statement.tokens: @@ -50,5 +50,5 @@ def requote_names(token_list): def process_statement(statement): - remove_directives(statement) + remove_directive_tokens(statement) requote_names(statement) diff --git a/tests/test_tokens.py b/tests/test_tokens.py index 2c930f7..2486654 100755 --- a/tests/test_tokens.py +++ b/tests/test_tokens.py @@ -5,7 +5,7 @@ import unittest from sqlparse import parse from sqlconvert.print_tokens import tlist2str -from sqlconvert.process_mysql import remove_directives, requote_names, \ +from sqlconvert.process_mysql import remove_directive_tokens, requote_names, \ is_directive_statement, process_statement from tests import main @@ -30,7 +30,7 @@ class TestTokens(unittest.TestCase): def test_directive(self): parsed = parse("select /*! test */ * from /* test */ `T`")[0] - remove_directives(parsed) + remove_directive_tokens(parsed) query = tlist2str(parsed) self.assertEqual(query, 'SELECT * FROM /* test */ `T`')