Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __add_known_types(self, to_datetime):
# these cannot be inferred from name
self.__add_type(String(self.__log, 'string'))
self.__add_type(AliasInteger(self.__log, 'enum', 'uint8'))
self.__add_type(AliasInteger(self.__log, 'byte', 'uint8'))
# these can be inferred
for name in BASE_TYPE_NAMES:
self.profile_to_type(name, auto_create=True)
self.base_types.append(self.profile_to_type(name))
# this is in the spreadsheet, but not in the doc
self.__add_type(Boolean(self.__log, 'bool'))
# these are defined in the spreadsheet, but the interpretation is in comments
self.__add_type(Date(self.__log, 'date_time', True, to_datetime=to_datetime))
self.__add_type(Date(self.__log, 'local_date_time', False, to_datetime=to_datetime))
def __add_known_types(self, to_datetime):
# these cannot be inferred from name
self.__add_type(String(self.__log, 'string'))
self.__add_type(AliasInteger(self.__log, 'enum', 'uint8'))
self.__add_type(AliasInteger(self.__log, 'byte', 'uint8'))
# these can be inferred
for name in BASE_TYPE_NAMES:
self.profile_to_type(name, auto_create=True)
self.base_types.append(self.profile_to_type(name))
# this is in the spreadsheet, but not in the doc
self.__add_type(Boolean(self.__log, 'bool'))
# these are defined in the spreadsheet, but the interpretation is in comments
self.__add_type(Date(self.__log, 'date_time', True, to_datetime=to_datetime))
self.__add_type(Date(self.__log, 'local_date_time', False, to_datetime=to_datetime))