'Generate BIND record line for the provided record.
:param record: Record to generate the line for.
:type  record: :class:`Record`
:return: Bind compatible record line.
:rtype: ``str``'

def _get_bind_record_line(self, record):

    parts = []
    if record.name:
        name = ('%(name)s.%(domain)s' % {'name': record.name, 'domain': record.zone.domain})
    else:
        name = record.zone.domain
    name += '.'
    ttl = (record.extra['ttl'] if ('ttl' in record.extra) else record.zone.ttl)
    ttl = str(ttl)
    data = record.data
    if (record.type in [RecordType.CNAME, RecordType.DNAME, RecordType.MX, RecordType.PTR, RecordType.SRV]):
        if (data[(len(data) - 1)] != '.'):
            data += '.'
    if ((record.type in [RecordType.TXT, RecordType.SPF]) and ('    ' in data)):
        data = data.replace('"', '\\"')
        data = ('"%s"' % data)
    if (record.type in [RecordType.MX, RecordType.SRV]):
        priority = str(record.extra['priority'])
        parts = [name, ttl, 'IN', record.type, priority, data]
    else:
        parts = [name, ttl, 'IN', record.type, data]
    line = ' DCTB '.join(parts)
    return line
