Compare commits

..

No commits in common. "master" and "2.0" have entirely different histories.
master ... 2.0

2 changed files with 10 additions and 13 deletions

View File

@ -1,14 +1,14 @@
import argparse
import operator
import sys
from io import BytesIO
from struct import calcsize
import sys
import operator
from io import BytesIO
import lxml.etree as etree
from .bytebuffer import ByteBuffer
from .format_ids import xml_formats, xml_types
from .sixbit import pack_sixbit, unpack_sixbit
from .format_ids import xml_formats, xml_types
DEBUG_OFFSETS = False
DEBUG = False
@ -479,14 +479,10 @@ def main():
xml = KBinXML(input, convert_illegal_things=args.convert_illegal)
stdout = getattr(sys.stdout, "buffer", sys.stdout)
try:
if KBinXML.is_binary_xml(input):
stdout.write(xml.to_text().encode("utf-8"))
else:
stdout.write(xml.to_binary())
except BrokenPipeError:
# allows kbinxml to be piped to `head` or similar
sys.exit(141)
if KBinXML.is_binary_xml(input):
stdout.write(xml.to_text().encode("utf-8"))
else:
stdout.write(xml.to_binary())
if __name__ == "__main__":

View File

@ -1,12 +1,13 @@
from setuptools import setup
requires = [
"lxml",
]
python_requires = ">=3.10"
version = "2.1"
version = "2.0"
setup(
name="kbinxml",
description="Decoder/encoder for Konami's binary XML format",