Skip to content
Permalink
Browse files

fix(base): fix duplicate warning

  • Loading branch information...
hanxiao committed Jul 19, 2019
1 parent 1b52154 commit b97acd6cc69d562c0577aeb86fda5f8301f9e26a
Showing with 0 additions and 9 deletions.
  1. +0 −9 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()))

0 comments on commit b97acd6

Please sign in to comment.
You can’t perform that action at this time.