File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import asyncio
5
5
import datetime as dt
6
- from functools import lru_cache
7
6
import logging
8
7
import os .path
9
8
from typing import Any , Callable
Original file line number Diff line number Diff line change 2
2
3
3
4
4
import ciso8601
5
- import isodate
6
5
from zeep .xsd .types .builtins import DateTime , treat_whitespace
7
6
8
7
@@ -13,17 +12,14 @@ class FastDateTime(DateTime):
13
12
@treat_whitespace ("collapse" )
14
13
def pythonvalue (self , value ):
15
14
"""Convert the xml value into a python value."""
15
+ if len (value ) > 10 and value [10 ] == "-" : # 2010-01-01-00:00:00...
16
+ value [10 ] = "T"
17
+ if len (value ) > 10 and value [11 ] == "-" : # 2023-05-15T-07:10:32Z...
18
+ value = value [:11 ] + value [12 :]
19
+
16
20
try :
17
21
return ciso8601 .parse_datetime (value )
18
22
except ValueError :
19
23
pass
20
- # Determine based on the length of the value if it only contains a date
21
- # lazy hack ;-)
22
24
23
- if len (value ) == 10 :
24
- value += "T00:00:00"
25
- elif (len (value ) == 19 or len (value ) == 26 ) and value [10 ] == " " :
26
- value = "T" .join (value .split (" " ))
27
- elif len (value ) > 10 and value [10 ] == "-" : # 2010-01-01-00:00:00...
28
- value [10 ] = "T"
29
- return isodate .parse_datetime (value )
25
+ return super ().pythonvalue (value )
Original file line number Diff line number Diff line change 10
10
requires = [
11
11
"httpx>=0.19.0,<1.0.0" ,
12
12
"zeep[async]>=4.2.1,<5.0.0" ,
13
- "ciso8601>=2.1.3" ,
14
- "isodate>=0.6.0" ,
13
+ "ciso8601>=2.1.3"
15
14
]
16
15
17
16
CLASSIFIERS = [
You can’t perform that action at this time.
0 commit comments