STAR-322: Checking if response changed before updating cluster

This commit is contained in:
Daniel Schiavini 2018-12-07 13:19:45 +01:00
parent 2b8358fda8
commit 5b963de2ea
13 changed files with 58 additions and 30 deletions

View file

@ -0,0 +1,17 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from datetime import datetime, timezone
from ...Models import BaseModel
class BaseCloudModel(BaseModel):
def __eq__(self, other):
return type(self) == type(other) and self.__dict__ == other.__dict__
def __ne__(self, other):
return type(self) != type(other) or self.__dict__ != other.__dict__
@staticmethod
def parseDate(date_str: str) -> datetime:
return datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=timezone.utc)