コード例 #1
0
 def test_basic(self):
     from unokit.adapters import InputStreamFromFileLike
     from hwp5_uno import inputstream_is_hwp5file
     from hwp5_uno import typedetect
     with self.open_fixture('sample-5017.hwp', 'rb') as f:
         inputstream = InputStreamFromFileLike(f, dontclose=True)
         self.assertTrue(inputstream_is_hwp5file(inputstream))
         self.assertEqual('hwp5', typedetect(inputstream))
コード例 #2
0
ファイル: components.py プロジェクト: hanul93/pyhwp
        def detect(self, mediadesc):
            from hwp5_uno import typedetect

            logger.info('hwp5.Detector detect()')

            desc = propseq_to_dict(mediadesc)
            for k, v in desc.items():
                logger.debug('\t%s: %s', k, v)

            inputstream = desc['InputStream']

            typename = typedetect(inputstream)

            logger.info('hwp5.Detector: %s detected.', typename)
            return typename, mediadesc
コード例 #3
0
        def detect(self, mediadesc):
            from hwp5_uno import typedetect

            logger.info('hwp5.Detector detect()')

            desc = propseq_to_dict(mediadesc)
            for k, v in desc.items():
                logger.debug('\t%s: %s', k, v)

            inputstream = desc['InputStream']

            typename = typedetect(inputstream)

            logger.info('hwp5.Detector: %s detected.', typename)
            return typename, mediadesc