_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.2.0'
+__version__ = '0.2.1'
LOG = logging.getLogger(__name__)
RE_SPLIT_SQ_CHUNK = re.compile(r"^'((?:\\'|[^'])*)'")
RE_SPLIT_DQ = re.compile(r'\\"')
RE_SPLIT_DQ_CHUNK = re.compile(r'^"((?:\\"|[^"])*)"')
-RE_SPLIT_UQ_CHUNK = re.compile(r'^((?:[^\s\'"]+|\\\'|\\")+)')
+RE_SPLIT_UQ_CHUNK = re.compile("^((?:[^\\s'\"]|\\'|\\\")+)")
RE_SPLIT_WS_ALL = re.compile(r'^\s*$')
RE_SPLIT_UNBALANCED = re.compile(r'^([\'"].*)\s*')
match = RE_SPLIT_DQ_CHUNK.search(txt)
if match:
chunk = match.group(1)
- chunk = RE_SPLIT_DQ('"', chunk)
+ chunk = RE_SPLIT_DQ.sub('"', chunk)
if keep_quotes:
chunk = '"' + chunk + '"'
last_chunk += chunk
match = RE_SPLIT_UQ_CHUNK.search(txt)
if match:
last_chunk += match.group(1)
+ last_chunk = RE_SPLIT_SQ.sub("'", last_chunk)
+ last_chunk = RE_SPLIT_DQ.sub('"', last_chunk)
txt = RE_SPLIT_UQ_CHUNK.sub('', txt)
continue