Logo Search packages:      
Sourcecode: zope-cmfbibliographyat version File versions  Download package

def CMFBibliographyAT::tool::bibliography::BibliographyTool::checkFormat (   self,
  source,
  format,
  file_name 
)

plausibility test whether 'source' has the 'format' specified
if not it tries to infer the format from the 'file_name'
raises an error if both fail

Definition at line 255 of file bibliography.py.

00255                                                     :
        """
        plausibility test whether 'source' has the 'format' specified
        if not it tries to infer the format from the 'file_name'
        raises an error if both fail
        """
        ok = 0
        if format:
            parser = self.getParser(format)
            ok = parser.checkFormat(source)
        if not ok and file_name:
            format = self.guessFormat(file_name)
        if format:
            return format
        else:
            raise  ImportParseError, "%s Parser's 'checkFormat' and " \
                  "guessing the format from the file name '%s' failed." \
                  % (format, file_name)

    def guessFormat(self, file_name):


Generated by  Doxygen 1.6.0   Back to index