import yaml


def file_spec_serializer(dumper, data):
    """
    Serialize a FileSpec object.  This is required for Yaml
    to serialize a FileSpec properly.
    """
    return dumper.represent_scalar(u'!FileSpec',
                                   u'%s' % yaml.dump([data.get_path(),
                                                      data.get_attributes()]))