]> git.phdru.name Git - sqlconvert.git/commitdiff
Rename remove_directives -> remove_directive_tokens
authorOleg Broytman <phd@phdru.name>
Sat, 10 Sep 2016 17:05:22 +0000 (20:05 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 10 Sep 2016 17:07:15 +0000 (20:07 +0300)
ChangeLog
sqlconvert/process_mysql.py
tests/test_tokens.py

index 597b210abcfc71c79119761219e016d3d8b6f805..6d0e1944899aff915987f7beeb58c3f95c1f1db2 100644 (file)
--- 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.
index 3f2f6aa3c7dee8ad84f60c3a630050c8f3d413b6..f91f516d2d9236f53dd320f5eb2a958545d54c9d 100644 (file)
@@ -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)
index 2c930f77e07593eafb835dcf4264d3cce3e14520..24866548cfa3b9abbbbd77d2ef35803badacb5b8 100755 (executable)
@@ -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`')