Replace multiple whitespace in strings to be parsed

This commit is contained in:
Davte 2020-02-11 14:43:15 +01:00
parent c2b50bc42c
commit ab6849b5e0
2 changed files with 5 additions and 2 deletions

View File

@ -14,7 +14,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0"
__version__ = "2.3.23"
__version__ = "2.3.24"
__maintainer__ = "Davide Testa"
__contact__ = "t.me/davte"

View File

@ -5,16 +5,18 @@ import asyncio
import collections
import csv
import datetime
from difflib import SequenceMatcher
import inspect
import io
import json
import logging
import os
import random
import re
import string
import time
from difflib import SequenceMatcher
# Third party modules
import aiohttp
from aiohttp import web
@ -1152,6 +1154,7 @@ def parse_datetime_interval_string(text):
parsers = []
result_text, result_datetime, result_timedelta = [], None, None
is_quoted_text = False
text = re.sub('\s\s+', ' ', text) # Replace multiple spaces with single space character
for word in text.split(' '):
if word.count('"') % 2:
is_quoted_text = not is_quoted_text