def __init__(self, flo, program_id=None, program_version=None, compact=False):
self._flo = flo
self._doc = minidom.Document()
root = self._doc.createElement('ADX')
self._doc.appendChild(root)
header = self._doc.createElement('HEADER')
header.appendChild(self._create_node('ADIF_VER', self.adif_ver))
tmp_data = datetime.datetime.utcnow().strftime('%Y%m%d %H%M%S')
header.appendChild(self._create_node('CREATED_TIMESTAMP', tmp_data))
if program_id:
header.appendChild(self._create_node('PROGRAMID', program_id))
if program_version:
header.appendChild(self._create_node('PROGRAMVERSION', program_version))
else:
from hamutils import __version__ as hamutils_version
header.appendChild(self._create_node('PROGRAMID', 'hamutils'))
header.appendChild(self._create_node('PROGRAMVERSION', hamutils_version))
root.appendChild(header)
self._records = self._doc.createElement('RECORDS')
root.appendChild(self._records)
self._compact = compact
评论列表
文章目录