File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 33class Base (object ):
44 def load (self , data ):
55 for name , value in list (data .items ()):
6- if hasattr (self , name ):
6+ if hasattr (self , name ) and not callable ( getattr ( self , name )) :
77 setattr (self , name , value )
88
99 return self
10-
11- def strip_nanoseconds_from_date (self , value ):
10+
11+ @staticmethod
12+ def strip_nanoseconds_from_date (value ):
1213 if str (value ).find ("." ) != - 1 :
1314 return value [:- 11 ] + value [- 1 :]
1415
1516 return value
1617
17- def value_to_time (self , value , format = '%Y-%m-%dT%H:%M:%S+00:00' ):
18- if value != None :
19- value = self .strip_nanoseconds_from_date (value )
20- return datetime .strptime (value , format )
18+ @staticmethod
19+ def value_to_time (value , format = '%Y-%m-%dT%H:%M:%S+00:00' ):
20+ if value is not None :
21+ value = Base .strip_nanoseconds_from_date (value )
22+ return datetime .strptime (value , format )
You can’t perform that action at this time.
0 commit comments