mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-22 17:35:28 +00:00
Maybe again?
This commit is contained in:
parent
fa64378c2b
commit
e61036dc51
|
@ -96,15 +96,16 @@ class ObjManip: # Object Manipulation
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def blank(string, downcase=True):
|
def blank(string, downcase=True):
|
||||||
|
if downcase:
|
||||||
|
string = string.lower()
|
||||||
import re
|
import re
|
||||||
regex = re.compile('[^a-zA-Z0-9\ ]')
|
regex = re.compile('[^a-zA-Z0-9\ ]')
|
||||||
if sys.version_info == 2:
|
if sys.version_info == 2:
|
||||||
string = regex.sub('', string.decode("utf8"))
|
string = regex.sub('', string.decode("utf8"))
|
||||||
|
return ' '.join(string.decode().split())
|
||||||
else:
|
else:
|
||||||
string = regex.sub('', string)
|
string = regex.sub('', string)
|
||||||
if downcase:
|
return ' '.join(string.split())
|
||||||
string = string.lower()
|
|
||||||
return ' '.join(string.decode().split())
|
|
||||||
|
|
||||||
def blank_include(this, includes_this):
|
def blank_include(this, includes_this):
|
||||||
this = ObjManip.blank(this)
|
this = ObjManip.blank(this)
|
||||||
|
|
Loading…
Reference in a new issue