monotone.py
411 lines
| 13.6 KiB
| text/x-python
|
PythonLexer
Martin Geisler
|
r8250 | # monotone.py - monotone support for the convert extension | ||
# | ||||
# Copyright 2008, 2009 Mikkel Fahnoe Jorgensen <mikkel@dvide.com> and | ||||
# others | ||||
# | ||||
# This software may be used and distributed according to the terms of the | ||||
Matt Mackall
|
r10263 | # GNU General Public License version 2 or any later version. | ||
timeless
|
r28372 | from __future__ import absolute_import | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
timeless
|
r28372 | import os | ||
import re | ||||
Yuya Nishihara
|
r29205 | from mercurial.i18n import _ | ||
Gregory Szorc
|
r43355 | from mercurial.pycompat import open | ||
timeless
|
r28372 | from mercurial import ( | ||
error, | ||||
Pulkit Goyal
|
r36347 | pycompat, | ||
timeless
|
r28372 | ) | ||
Boris Feld
|
r36625 | from mercurial.utils import dateutil | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
timeless
|
r28372 | from . import common | ||
Augie Fackler
|
r43346 | |||
timeless
|
r28372 | class monotone_source(common.converter_source, common.commandline): | ||
Matt Harbison
|
r35168 | def __init__(self, ui, repotype, path=None, revs=None): | ||
common.converter_source.__init__(self, ui, repotype, path, revs) | ||||
Durham Goode
|
r25748 | if revs and len(revs) > 1: | ||
Augie Fackler
|
r43346 | raise error.Abort( | ||
_( | ||||
Augie Fackler
|
r43347 | b'monotone source does not support specifying ' | ||
b'multiple revs' | ||||
Augie Fackler
|
r43346 | ) | ||
) | ||||
Augie Fackler
|
r43347 | common.commandline.__init__(self, ui, b'mtn') | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | self.ui = ui | ||
self.path = path | ||||
Daniel Atallah
|
r13760 | self.automatestdio = False | ||
Durham Goode
|
r25748 | self.revs = revs | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
Augie Fackler
|
r43346 | norepo = common.NoRepo( | ||
Augie Fackler
|
r43347 | _(b"%s does not look like a monotone repository") % path | ||
Augie Fackler
|
r43346 | ) | ||
Augie Fackler
|
r43347 | if not os.path.exists(os.path.join(path, b'_MTN')): | ||
Patrick Mezard
|
r8052 | # Could be a monotone repository (SQLite db file) | ||
try: | ||||
Augie Fackler
|
r43347 | f = open(path, b'rb') | ||
Matt Mackall
|
r14179 | header = f.read(16) | ||
f.close() | ||||
Brodie Rao
|
r16688 | except IOError: | ||
Augie Fackler
|
r43347 | header = b'' | ||
if header != b'SQLite format 3\x00': | ||||
Patrick Mezard
|
r8052 | raise norepo | ||
Matt Mackall
|
r7973 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | # regular expressions for parsing monotone output | ||
Augie Fackler
|
r43346 | space = br'\s*' | ||
name = br'\s+"((?:\\"|[^"])*)"\s*' | ||||
value = name | ||||
Pulkit Goyal
|
r36411 | revision = br'\s+\[(\w+)\]\s*' | ||
Augie Fackler
|
r43346 | lines = br'(?:.|\n)+' | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Augie Fackler
|
r43347 | self.dir_re = re.compile(space + b"dir" + name) | ||
self.file_re = re.compile( | ||||
space + b"file" + name + b"content" + revision | ||||
) | ||||
Augie Fackler
|
r43346 | self.add_file_re = re.compile( | ||
Augie Fackler
|
r43347 | space + b"add_file" + name + b"content" + revision | ||
Augie Fackler
|
r43346 | ) | ||
self.patch_re = re.compile( | ||||
Augie Fackler
|
r43347 | space + b"patch" + name + b"from" + revision + b"to" + revision | ||
Augie Fackler
|
r43346 | ) | ||
Augie Fackler
|
r43347 | self.rename_re = re.compile(space + b"rename" + name + b"to" + name) | ||
self.delete_re = re.compile(space + b"delete" + name) | ||||
self.tag_re = re.compile(space + b"tag" + name + b"revision" + revision) | ||||
Augie Fackler
|
r43346 | self.cert_re = re.compile( | ||
Augie Fackler
|
r43347 | lines + space + b"name" + name + b"value" + value | ||
Augie Fackler
|
r43346 | ) | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
Augie Fackler
|
r43347 | attr = space + b"file" + lines + space + b"attr" + space | ||
Augie Fackler
|
r43346 | self.attr_execute_re = re.compile( | ||
Augie Fackler
|
r43347 | attr + b'"mtn:execute"' + space + b'"true"' | ||
Augie Fackler
|
r43346 | ) | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
# cached data | ||||
self.manifest_rev = None | ||||
self.manifest = None | ||||
Mikkel Fahnøe Jørgensen
|
r6307 | self.files = None | ||
Augie Fackler
|
r43346 | self.dirs = None | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Augie Fackler
|
r43347 | common.checktool(b'mtn', abort=False) | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
def mtnrun(self, *args, **kwargs): | ||||
Daniel Atallah
|
r13760 | if self.automatestdio: | ||
return self.mtnrunstdio(*args, **kwargs) | ||||
else: | ||||
return self.mtnrunsingle(*args, **kwargs) | ||||
def mtnrunsingle(self, *args, **kwargs): | ||||
Augie Fackler
|
r43906 | kwargs['d'] = self.path | ||
Augie Fackler
|
r43347 | return self.run0(b'automate', *args, **kwargs) | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Daniel Atallah
|
r13760 | def mtnrunstdio(self, *args, **kwargs): | ||
# Prepare the command in automate stdio format | ||||
Pulkit Goyal
|
r36347 | kwargs = pycompat.byteskwargs(kwargs) | ||
Daniel Atallah
|
r13760 | command = [] | ||
Gregory Szorc
|
r43375 | for k, v in pycompat.iteritems(kwargs): | ||
Augie Fackler
|
r43347 | command.append(b"%d:%s" % (len(k), k)) | ||
Daniel Atallah
|
r13760 | if v: | ||
Augie Fackler
|
r43347 | command.append(b"%d:%s" % (len(v), v)) | ||
Daniel Atallah
|
r13760 | if command: | ||
Augie Fackler
|
r43347 | command.insert(0, b'o') | ||
command.append(b'e') | ||||
Daniel Atallah
|
r13760 | |||
Augie Fackler
|
r43347 | command.append(b'l') | ||
Daniel Atallah
|
r13760 | for arg in args: | ||
Augie Fackler
|
r43347 | command.append(b"%d:%s" % (len(arg), arg)) | ||
command.append(b'e') | ||||
command = b''.join(command) | ||||
Daniel Atallah
|
r13760 | |||
Augie Fackler
|
r43347 | self.ui.debug(b"mtn: sending '%s'\n" % command) | ||
Daniel Atallah
|
r13760 | self.mtnwritefp.write(command) | ||
self.mtnwritefp.flush() | ||||
return self.mtnstdioreadcommandoutput(command) | ||||
def mtnstdioreadpacket(self): | ||||
read = None | ||||
Augie Fackler
|
r43347 | commandnbr = b'' | ||
while read != b':': | ||||
Daniel Atallah
|
r13760 | read = self.mtnreadfp.read(1) | ||
if not read: | ||||
Augie Fackler
|
r43347 | raise error.Abort(_(b'bad mtn packet - no end of commandnbr')) | ||
Daniel Atallah
|
r13760 | commandnbr += read | ||
commandnbr = commandnbr[:-1] | ||||
stream = self.mtnreadfp.read(1) | ||||
Augie Fackler
|
r43347 | if stream not in b'mewptl': | ||
raise error.Abort( | ||||
_(b'bad mtn packet - bad stream type %s') % stream | ||||
) | ||||
Daniel Atallah
|
r13760 | |||
read = self.mtnreadfp.read(1) | ||||
Augie Fackler
|
r43347 | if read != b':': | ||
raise error.Abort(_(b'bad mtn packet - no divider before size')) | ||||
Daniel Atallah
|
r13760 | |||
read = None | ||||
Augie Fackler
|
r43347 | lengthstr = b'' | ||
while read != b':': | ||||
Daniel Atallah
|
r13760 | read = self.mtnreadfp.read(1) | ||
if not read: | ||||
Augie Fackler
|
r43347 | raise error.Abort(_(b'bad mtn packet - no end of packet size')) | ||
Daniel Atallah
|
r13760 | lengthstr += read | ||
try: | ||||
Pulkit Goyal
|
r41666 | length = pycompat.long(lengthstr[:-1]) | ||
Daniel Atallah
|
r13760 | except TypeError: | ||
Augie Fackler
|
r43346 | raise error.Abort( | ||
Augie Fackler
|
r43347 | _(b'bad mtn packet - bad packet size %s') % lengthstr | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | |||
read = self.mtnreadfp.read(length) | ||||
if len(read) != length: | ||||
Augie Fackler
|
r43346 | raise error.Abort( | ||
_( | ||||
Augie Fackler
|
r43347 | b"bad mtn packet - unable to read full packet " | ||
b"read %s of %s" | ||||
Augie Fackler
|
r43346 | ) | ||
% (len(read), length) | ||||
) | ||||
Daniel Atallah
|
r13760 | |||
return (commandnbr, stream, length, read) | ||||
def mtnstdioreadcommandoutput(self, command): | ||||
Daniel Atallah
|
r13792 | retval = [] | ||
Daniel Atallah
|
r13760 | while True: | ||
commandnbr, stream, length, output = self.mtnstdioreadpacket() | ||||
Augie Fackler
|
r43346 | self.ui.debug( | ||
Augie Fackler
|
r43347 | b'mtn: read packet %s:%s:%d\n' % (commandnbr, stream, length) | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | |||
Augie Fackler
|
r43347 | if stream == b'l': | ||
Daniel Atallah
|
r13760 | # End of command | ||
Augie Fackler
|
r43347 | if output != b'0': | ||
Augie Fackler
|
r43346 | raise error.Abort( | ||
Augie Fackler
|
r43347 | _(b"mtn command '%s' returned %s") % (command, output) | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | break | ||
Augie Fackler
|
r43347 | elif stream in b'ew': | ||
Daniel Atallah
|
r13760 | # Error, warning output | ||
Augie Fackler
|
r43347 | self.ui.warn(_(b'%s error:\n') % self.command) | ||
Daniel Atallah
|
r13760 | self.ui.warn(output) | ||
Augie Fackler
|
r43347 | elif stream == b'p': | ||
Daniel Atallah
|
r13760 | # Progress messages | ||
Augie Fackler
|
r43347 | self.ui.debug(b'mtn: ' + output) | ||
elif stream == b'm': | ||||
Daniel Atallah
|
r13760 | # Main stream - command output | ||
Daniel Atallah
|
r13792 | retval.append(output) | ||
Daniel Atallah
|
r13760 | |||
Augie Fackler
|
r43347 | return b''.join(retval) | ||
Daniel Atallah
|
r13760 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | def mtnloadmanifest(self, rev): | ||
if self.manifest_rev == rev: | ||||
return | ||||
Augie Fackler
|
r43347 | self.manifest = self.mtnrun(b"get_manifest_of", rev).split(b"\n\n") | ||
Mikkel Fahnøe Jørgensen
|
r6306 | self.manifest_rev = rev | ||
Mikkel Fahnøe Jørgensen
|
r6307 | self.files = {} | ||
self.dirs = {} | ||||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
Mikkel Fahnøe Jørgensen
|
r6307 | for e in self.manifest: | ||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.file_re.match(e) | ||
Mikkel Fahnøe Jørgensen
|
r6307 | if m: | ||
Augie Fackler
|
r43347 | attr = b"" | ||
Mikkel Fahnøe Jørgensen
|
r6306 | name = m.group(1) | ||
node = m.group(2) | ||||
if self.attr_execute_re.match(e): | ||||
Augie Fackler
|
r43347 | attr += b"x" | ||
Mikkel Fahnøe Jørgensen
|
r6307 | self.files[name] = (node, attr) | ||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.dir_re.match(e) | ||
if m: | ||||
Mikkel Fahnøe Jørgensen
|
r6307 | self.dirs[m.group(1)] = True | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
def mtnisfile(self, name, rev): | ||||
# a non-file could be a directory or a deleted or renamed file | ||||
self.mtnloadmanifest(rev) | ||||
Benoit Boissinot
|
r8458 | return name in self.files | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | def mtnisdir(self, name, rev): | ||
self.mtnloadmanifest(rev) | ||||
Benoit Boissinot
|
r8458 | return name in self.dirs | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | def mtngetcerts(self, rev): | ||
Augie Fackler
|
r43346 | certs = { | ||
Augie Fackler
|
r43347 | b"author": b"<missing>", | ||
b"date": b"<missing>", | ||||
b"changelog": b"<missing>", | ||||
b"branch": b"<missing>", | ||||
Augie Fackler
|
r43346 | } | ||
Augie Fackler
|
r43347 | certlist = self.mtnrun(b"certs", rev) | ||
Patrick Mezard
|
r9823 | # mtn < 0.45: | ||
# key "test@selenic.com" | ||||
# mtn >= 0.45: | ||||
# key [ff58a7ffb771907c4ff68995eada1c4da068d328] | ||||
Matt Harbison
|
r44472 | certlist = re.split(br'\n\n {6}key ["\[]', certlist) | ||
Patrick Mezard
|
r9823 | for e in certlist: | ||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.cert_re.match(e) | ||
if m: | ||||
David Reiss
|
r6632 | name, value = m.groups() | ||
Augie Fackler
|
r43347 | value = value.replace(br'\"', b'"') | ||
value = value.replace(br'\\', b'\\') | ||||
David Reiss
|
r6632 | certs[name] = value | ||
Paul Aurich
|
r8101 | # Monotone may have subsecond dates: 2005-02-05T09:39:12.364306 | ||
Paul Aurich
|
r8125 | # and all times are stored in UTC | ||
Augie Fackler
|
r43347 | certs[b"date"] = certs[b"date"].split(b'.')[0] + b" UTC" | ||
Mikkel Fahnøe Jørgensen
|
r6306 | return certs | ||
# implement the converter_source interface: | ||||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
Mikkel Fahnøe Jørgensen
|
r6306 | def getheads(self): | ||
Durham Goode
|
r25748 | if not self.revs: | ||
Augie Fackler
|
r43347 | return self.mtnrun(b"leaves").splitlines() | ||
Mikkel Fahnøe Jørgensen
|
r6306 | else: | ||
Durham Goode
|
r25748 | return self.revs | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
Mads Kiilerich
|
r22300 | def getchanges(self, rev, full): | ||
if full: | ||||
Augie Fackler
|
r43346 | raise error.Abort( | ||
Martin von Zweigbergk
|
r43387 | _(b"convert from monotone does not support --full") | ||
Augie Fackler
|
r43346 | ) | ||
Augie Fackler
|
r43347 | revision = self.mtnrun(b"get_revision", rev).split(b"\n\n") | ||
Mikkel Fahnøe Jørgensen
|
r6306 | files = {} | ||
Patrick Mezard
|
r8123 | ignoremove = {} | ||
Patrick Mezard
|
r8099 | renameddirs = [] | ||
Mikkel Fahnøe Jørgensen
|
r6306 | copies = {} | ||
for e in revision: | ||||
m = self.add_file_re.match(e) | ||||
if m: | ||||
files[m.group(1)] = rev | ||||
Patrick Mezard
|
r8123 | ignoremove[m.group(1)] = rev | ||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.patch_re.match(e) | ||
if m: | ||||
files[m.group(1)] = rev | ||||
# Delete/rename is handled later when the convert engine | ||||
# discovers an IOError exception from getfile, | ||||
# but only if we add the "from" file to the list of changes. | ||||
Patrick Mezard
|
r6376 | m = self.delete_re.match(e) | ||
if m: | ||||
files[m.group(1)] = rev | ||||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.rename_re.match(e) | ||
if m: | ||||
toname = m.group(2) | ||||
fromname = m.group(1) | ||||
if self.mtnisfile(toname, rev): | ||||
Patrick Mezard
|
r8123 | ignoremove[toname] = 1 | ||
Mikkel Fahnøe Jørgensen
|
r6306 | copies[toname] = fromname | ||
files[toname] = rev | ||||
files[fromname] = rev | ||||
Patrick Mezard
|
r8099 | elif self.mtnisdir(toname, rev): | ||
renameddirs.append((fromname, toname)) | ||||
# Directory renames can be handled only once we have recorded | ||||
# all new files | ||||
for fromdir, todir in renameddirs: | ||||
renamed = {} | ||||
for tofile in self.files: | ||||
Patrick Mezard
|
r8123 | if tofile in ignoremove: | ||
Patrick Mezard
|
r8099 | continue | ||
Augie Fackler
|
r43347 | if tofile.startswith(todir + b'/'): | ||
Augie Fackler
|
r43346 | renamed[tofile] = fromdir + tofile[len(todir) :] | ||
Patrick Mezard
|
r8124 | # Avoid chained moves like: | ||
# d1(/a) => d3/d1(/a) | ||||
# d2 => d3 | ||||
ignoremove[tofile] = 1 | ||||
Patrick Mezard
|
r8099 | for tofile, fromfile in renamed.items(): | ||
Augie Fackler
|
r42431 | self.ui.debug( | ||
Augie Fackler
|
r43347 | b"copying file in renamed directory from '%s' to '%s'" | ||
Augie Fackler
|
r43346 | % (fromfile, tofile), | ||
Augie Fackler
|
r43347 | b'\n', | ||
Augie Fackler
|
r43346 | ) | ||
Patrick Mezard
|
r8099 | files[tofile] = rev | ||
copies[tofile] = fromfile | ||||
for fromfile in renamed.values(): | ||||
files[fromfile] = rev | ||||
Mads Kiilerich
|
r24395 | return (files.items(), copies, set()) | ||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
def getfile(self, name, rev): | ||||
if not self.mtnisfile(name, rev): | ||||
Mads Kiilerich
|
r22296 | return None, None | ||
Mikkel Fahnøe Jørgensen
|
r6307 | try: | ||
Augie Fackler
|
r43347 | data = self.mtnrun(b"get_file_of", name, r=rev) | ||
Brodie Rao
|
r16689 | except Exception: | ||
Mads Kiilerich
|
r22296 | return None, None | ||
Patrick Mezard
|
r11134 | self.mtnloadmanifest(rev) | ||
Augie Fackler
|
r43347 | node, attr = self.files.get(name, (None, b"")) | ||
Patrick Mezard
|
r11134 | return data, attr | ||
Mikkel Fahnøe Jørgensen
|
r6307 | |||
def getcommit(self, rev): | ||||
Daniel Atallah
|
r13779 | extra = {} | ||
certs = self.mtngetcerts(rev) | ||||
Augie Fackler
|
r43347 | if certs.get(b'suspend') == certs[b"branch"]: | ||
extra[b'close'] = 1 | ||||
dateformat = b"%Y-%m-%dT%H:%M:%S" | ||||
timeless
|
r28372 | return common.commit( | ||
Augie Fackler
|
r43347 | author=certs[b"author"], | ||
date=dateutil.datestr(dateutil.strdate(certs[b"date"], dateformat)), | ||||
desc=certs[b"changelog"], | ||||
Mikkel Fahnøe Jørgensen
|
r6306 | rev=rev, | ||
Augie Fackler
|
r43347 | parents=self.mtnrun(b"parents", rev).splitlines(), | ||
branch=certs[b"branch"], | ||||
Augie Fackler
|
r43346 | extra=extra, | ||
) | ||||
Mikkel Fahnøe Jørgensen
|
r6306 | |||
def gettags(self): | ||||
tags = {} | ||||
Augie Fackler
|
r43347 | for e in self.mtnrun(b"tags").split(b"\n\n"): | ||
Mikkel Fahnøe Jørgensen
|
r6306 | m = self.tag_re.match(e) | ||
if m: | ||||
tags[m.group(1)] = m.group(2) | ||||
return tags | ||||
def getchangedfiles(self, rev, i): | ||||
# This function is only needed to support --filemap | ||||
# ... and we don't support that | ||||
Brodie Rao
|
r16687 | raise NotImplementedError | ||
Daniel Atallah
|
r13760 | |||
def before(self): | ||||
# Check if we have a new enough version to use automate stdio | ||||
try: | ||||
Augie Fackler
|
r43347 | versionstr = self.mtnrunsingle(b"interface_version") | ||
Daniel Atallah
|
r13760 | version = float(versionstr) | ||
except Exception: | ||||
Augie Fackler
|
r43346 | raise error.Abort( | ||
Martin von Zweigbergk
|
r43387 | _(b"unable to determine mtn automate interface version") | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | |||
if version >= 12.0: | ||||
self.automatestdio = True | ||||
Augie Fackler
|
r43346 | self.ui.debug( | ||
Augie Fackler
|
r43347 | b"mtn automate version %f - using automate stdio\n" % version | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | |||
# launch the long-running automate stdio process | ||||
Augie Fackler
|
r43346 | self.mtnwritefp, self.mtnreadfp = self._run2( | ||
Augie Fackler
|
r43347 | b'automate', b'stdio', b'-d', self.path | ||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | # read the headers | ||
read = self.mtnreadfp.readline() | ||||
Augie Fackler
|
r43347 | if read != b'format-version: 2\n': | ||
Augie Fackler
|
r43346 | raise error.Abort( | ||
Augie Fackler
|
r43347 | _(b'mtn automate stdio header unexpected: %s') % read | ||
Augie Fackler
|
r43346 | ) | ||
Augie Fackler
|
r43347 | while read != b'\n': | ||
Daniel Atallah
|
r13760 | read = self.mtnreadfp.readline() | ||
if not read: | ||||
Augie Fackler
|
r43346 | raise error.Abort( | ||
_( | ||||
Augie Fackler
|
r43347 | b"failed to reach end of mtn automate " | ||
b"stdio headers" | ||||
Augie Fackler
|
r43346 | ) | ||
) | ||||
Daniel Atallah
|
r13760 | else: | ||
Augie Fackler
|
r43346 | self.ui.debug( | ||
Augie Fackler
|
r43347 | b"mtn automate version %s - not using automate stdio " | ||
b"(automate >= 12.0 - mtn >= 0.46 is needed)\n" % version | ||||
Augie Fackler
|
r43346 | ) | ||
Daniel Atallah
|
r13760 | |||
def after(self): | ||||
if self.automatestdio: | ||||
self.mtnwritefp.close() | ||||
self.mtnwritefp = None | ||||
self.mtnreadfp.close() | ||||
self.mtnreadfp = None | ||||