def on_created(self, event):
if os.path.isdir(event.src_path):<EOL><INDENT>return<EOL><DEDENT>logger.debug("<STR_LIT>", event.src_path)<EOL>name = self.file_name(event)<EOL>try:<EOL><INDENT>result = self.target_class.from_config(<EOL>name, yaml.load(open(event.src_path))<EOL>)<EOL><DEDENT>except Exception as e:<EOL><INDENT>logger.exception(<EOL>"<STR_LIT>",<EOL>event.src_path, str(e)<EOL>)<EOL>return<EOL><DEDENT>if not result:<EOL><INDENT>return<EOL><DEDENT>self.on_add(self.target_class, name, result)<EOL>
Newly created config file handler.

Parses the file's yaml contents and creates a new instance of the
target_class with the results.  Fires the on_add callback with the
new instance.