Commit ae5ff5e46666d6e4deac209b1a39c2e0ae16a4c6
1 parent
d3127879
various: adjust import of io_encoding functions
Showing
6 changed files
with
8 additions
and
8 deletions
oletools/msodde.py
| ... | ... | @@ -74,7 +74,7 @@ from oletools import xls_parser |
| 74 | 74 | from oletools import rtfobj |
| 75 | 75 | from oletools.ppt_record_parser import is_ppt |
| 76 | 76 | from oletools import crypto |
| 77 | -from oletools.common import ensure_stdout_handles_unicode | |
| 77 | +from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 78 | 78 | from oletools.common.log_helper import log_helper |
| 79 | 79 | |
| 80 | 80 | # ----------------------------------------------------------------------------- | ... | ... |
oletools/olemeta.py
| ... | ... | @@ -79,7 +79,7 @@ if not _parent_dir in sys.path: |
| 79 | 79 | import olefile |
| 80 | 80 | from oletools.thirdparty import xglob |
| 81 | 81 | from oletools.thirdparty.tablestream import tablestream |
| 82 | -from oletools.common import ensure_stdout_handles_unicode | |
| 82 | +from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | #=== MAIN ================================================================= | ... | ... |
oletools/oleobj.py
| ... | ... | @@ -73,7 +73,7 @@ except ImportError: |
| 73 | 73 | from oletools.ppt_record_parser import (is_ppt, PptFile, |
| 74 | 74 | PptRecordExOleVbaActiveXAtom) |
| 75 | 75 | from oletools.ooxml import XmlParser |
| 76 | -from oletools.common import ensure_stdout_handles_unicode | |
| 76 | +from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 77 | 77 | |
| 78 | 78 | # ----------------------------------------------------------------------------- |
| 79 | 79 | # CHANGELOG: | ... | ... |
oletools/olevba.py
| ... | ... | @@ -317,7 +317,7 @@ from oletools import ppt_parser |
| 317 | 317 | from oletools import oleform |
| 318 | 318 | from oletools import rtfobj |
| 319 | 319 | from oletools import crypto |
| 320 | -from oletools.common import ensure_stdout_handles_unicode | |
| 320 | +from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 321 | 321 | from oletools.common import codepages |
| 322 | 322 | |
| 323 | 323 | # monkeypatch email to fix issue #32: | ... | ... |
oletools/ooxml.py
| ... | ... | @@ -17,7 +17,7 @@ TODO: "xml2003" == "flatopc"? |
| 17 | 17 | |
| 18 | 18 | import sys |
| 19 | 19 | from oletools.common.log_helper import log_helper |
| 20 | -from oletools.common import uopen | |
| 20 | +from oletools.common.io_encoding import uopen | |
| 21 | 21 | from zipfile import ZipFile, BadZipfile, is_zipfile |
| 22 | 22 | from os.path import splitext |
| 23 | 23 | import io |
| ... | ... | @@ -650,7 +650,7 @@ def test(): |
| 650 | 650 | |
| 651 | 651 | see module doc for more info |
| 652 | 652 | """ |
| 653 | - from oletools.common import ensure_stdout_handles_unicode | |
| 653 | + from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 654 | 654 | ensure_stdout_handles_unicode() |
| 655 | 655 | log_helper.enable_logging(False, 'debug') |
| 656 | 656 | if len(sys.argv) != 2: | ... | ... |
tests/common/test_encoding_handler.py
| ... | ... | @@ -131,7 +131,7 @@ class TestEncodingHandler(unittest.TestCase): |
| 131 | 131 | |
| 132 | 132 | def run_read(filename): |
| 133 | 133 | """This is called from test_uopen* tests as script. Reads text, compares""" |
| 134 | - from oletools.common import uopen | |
| 134 | + from oletools.common.io_encoding import uopen | |
| 135 | 135 | # open file |
| 136 | 136 | with uopen(filename, 'rt') as reader: |
| 137 | 137 | # a few tests |
| ... | ... | @@ -168,7 +168,7 @@ def run_read(filename): |
| 168 | 168 | |
| 169 | 169 | def run_print(): |
| 170 | 170 | """This is called from test_read* tests as script. Prints & logs unicode""" |
| 171 | - from oletools.common import ensure_stdout_handles_unicode | |
| 171 | + from oletools.common.io_encoding import ensure_stdout_handles_unicode | |
| 172 | 172 | from oletools.common.log_helper import log_helper |
| 173 | 173 | ensure_stdout_handles_unicode() |
| 174 | 174 | print(u'Check: \u2713') # print check mark | ... | ... |