This function implements loading a YAML file and populating a new
        empty layer (Layer) with its contents

        :param filename: The name of a file to read
        :type filename: string

def add_layer_from_yaml_file(self, filename):
        """This function implements loading a YAML file and populating a new
        empty layer (Layer) with its contents

        :param filename: The name of a file to read
        :type filename: string
        """
        if filename.endswith(('.yaml', '.yml')):
            file_stream = None
            try:
                file_stream = open(os.path.abspath(filename), 'r')
                stack = yaml.safe_load(file_stream)

                self.add_layer()
                for attribute in stack:
                    setattr(self, attribute, stack[attribute])
                del stack
            except (TypeError, IOError):
                logging.info("Could not import stack from %s" % filename)
            finally:
                if file_stream:
                    file_stream.close()