mirror of https://github.com/tLDP/python-tldp
only guess the doctype once
This commit is contained in:
parent
547cb303f6
commit
f6f6d4b543
|
@ -79,6 +79,7 @@ class SourceDocument(object):
|
||||||
raise TypeError("Wrong type, not a plain file: " + self.filename)
|
raise TypeError("Wrong type, not a plain file: " + self.filename)
|
||||||
|
|
||||||
logger.debug("Found existing %s", self.filename)
|
logger.debug("Found existing %s", self.filename)
|
||||||
|
self.doctype = self._doctype()
|
||||||
self.dirname, self.basename = os.path.split(self.filename)
|
self.dirname, self.basename = os.path.split(self.filename)
|
||||||
self.stem, self.ext = os.path.splitext(self.basename)
|
self.stem, self.ext = os.path.splitext(self.basename)
|
||||||
self.stat = os.stat(self.filename)
|
self.stat = os.stat(self.filename)
|
||||||
|
@ -92,8 +93,7 @@ class SourceDocument(object):
|
||||||
if os.path.exists(os.path.join(self.dirname, rdir)):
|
if os.path.exists(os.path.join(self.dirname, rdir)):
|
||||||
self.resources = True
|
self.resources = True
|
||||||
|
|
||||||
@property
|
def _doctype(self):
|
||||||
def doctype(self):
|
|
||||||
return guess(self.filename)
|
return guess(self.filename)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue