==========================================
Like-String create function with wildcards
==========================================

The like-string tool/function enables creation of like statements
that can later on be specified in the SQLAlchemy like expression.

The idea is to use the more commonly known wildcard characters "*" and
"?" instead of the SQL '%' and '_'. The escape character is the backslash.

User search strings, such as "John*", can be converted into a suitable
like clause.

 >>> from sa_tools.tools import mk_likestr

First of all, a like string is only created if needed. Thus the function
returns the converted string and denotes, if it's a like clause or not.

First, let's test various combinations of non-wildcard and therefore 
non-like strings:

 >>> mk_likestr('abc')
 ('abc', False)

If wildcards are escaped, they are converted, so that they will match:

 >>> mk_likestr('a\*bc')
 ('a*bc', False)
 >>> mk_likestr('a\?bc')
 ('a?bc', False)
 >>> mk_likestr('a\*b\*c')
 ('a*b*c', False)

SQL wildcards are left as-is, as no like operation is performed:

 >>> mk_likestr('a_c%')
 ('a_c%', False)

Now let's test wildcards/create like-strings (Note, that the double
backslashes are only displayed here, the string itself does not contain them):

 >>> mk_likestr('a*b_c')
 ('a%b\\_c', True)
 >>> mk_likestr('*abc')
 ('%abc', True)
 >>> mk_likestr('abc?')
 ('abc_', True)
 >>> mk_likestr('a\*b*c_d')
 ('a*b%c\\_d', True)

