From b97acd6cc69d562c0577aeb86fda5f8301f9e26a Mon Sep 17 00:00:00 2001 From: hanhxiao Date: Fri, 19 Jul 2019 15:47:23 +0800 Subject: [PATCH] fix(base): fix duplicate warning --- gnes/base/__init__.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/gnes/base/__init__.py b/gnes/base/__init__.py index d2853dec..35ed943f 100644 --- a/gnes/base/__init__.py +++ b/gnes/base/__init__.py @@ -153,15 +153,6 @@ def __init__(self, *args, **kwargs): self.verbose = 'verbose' in kwargs and kwargs['verbose'] self.logger = set_logger(self.__class__.__name__, self.verbose) self._post_init_vars = set() - if not getattr(self, 'name', None): - _id = str(uuid.uuid4()).split('-')[0] - _name = '%s-%s' % (self.__class__.__name__, _id) - self.logger.warning( - 'this object is not named ("- gnes_config: - name" is not found in YAML config), ' - 'i will call it as "%s". ' - 'However, naming the object is important especially when you need to ' - 'serialize/deserialize/store/load the object.' % _name) - setattr(self, 'name', _name) def _post_init_wrapper(self): _before = set(list(self.__dict__.keys()))