Exemple #1
0
def main(args):
    from hwp5.filestructure import Hwp5File
    hwp5file = Hwp5File(args['<hwp5file>'])
    f = hwp5file.header.open_text()
    try:
        shutil.copyfileobj(f, sys.stdout)
    finally:
        hwp5file.close()
 def test_init_should_accept_fs(self):
     outpath = 'test_init_should_accept_fs'
     if os.path.exists(outpath):
         shutil.rmtree(outpath)
     os.mkdir(outpath)
     unpack(self.olestg, outpath)
     fs = FileSystemStorage(outpath)
     hwp5file = Hwp5File(fs)
     fileheader = hwp5file['FileHeader']
     self.assertTrue(fileheader is not None)
     self.assertEquals((5, 0, 1, 7), fileheader.version)
Exemple #3
0
def main(args):
    from hwp5.filestructure import Hwp5File
    hwp5file = Hwp5File(args['<hwp5file>'])
    f = hwp5file.header.open_text()
    try:
        try:
            for line in f:
                print line,
        finally:
            f.close()
    finally:
        hwp5file.close()
Exemple #4
0
def main(args):
    if PY2:
        output_fp = sys.stdout
    else:
        output_fp = sys.stdout.buffer

    from hwp5.filestructure import Hwp5File
    hwp5file = Hwp5File(args['<hwp5file>'])
    f = hwp5file.header.open_text()
    try:
        shutil.copyfileobj(f, output_fp)
    finally:
        hwp5file.close()
 def test_init_should_accept_olestorage(self):
     hwp5file = Hwp5File(self.olestg)
     self.assertTrue(hwp5file['FileHeader'] is not None)
 def test_init_should_accept_string_path(self):
     hwp5file = Hwp5File(self.hwp5file_path)
     self.assertTrue(hwp5file['FileHeader'] is not None)
Exemple #7
0
def main(args):
    from hwp5.filestructure import Hwp5File
    hwp5file = Hwp5File(args['<hwp5file>'])
    h = hwp5file.fileheader
    # print h.signature.replace('\x00', ''),
    print '%d.%d.%d.%d' % h.version
Exemple #8
0
 def test_init_should_accept_olestorage(self):
     from hwp5.filestructure import Hwp5File
     hwp5file = Hwp5File(self.olestg)
     self.assertTrue(hwp5file['FileHeader'] is not None)
Exemple #9
0
 def test_init_should_accept_string_path(self):
     from hwp5.filestructure import Hwp5File
     hwp5file = Hwp5File(self.hwp5file_path)
     self.assertTrue(hwp5file['FileHeader'] is not None)