mirror of
https://github.com/mon/kbinxml.git
synced 2026-03-28 13:14:40 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b6a3580cc |
|
|
@ -1,14 +1,14 @@
|
||||||
import argparse
|
import argparse
|
||||||
from struct import calcsize
|
|
||||||
import sys
|
|
||||||
import operator
|
import operator
|
||||||
|
import sys
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
from struct import calcsize
|
||||||
|
|
||||||
import lxml.etree as etree
|
import lxml.etree as etree
|
||||||
|
|
||||||
from .bytebuffer import ByteBuffer
|
from .bytebuffer import ByteBuffer
|
||||||
from .sixbit import pack_sixbit, unpack_sixbit
|
|
||||||
from .format_ids import xml_formats, xml_types
|
from .format_ids import xml_formats, xml_types
|
||||||
|
from .sixbit import pack_sixbit, unpack_sixbit
|
||||||
|
|
||||||
DEBUG_OFFSETS = False
|
DEBUG_OFFSETS = False
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
@ -479,10 +479,14 @@ def main():
|
||||||
|
|
||||||
xml = KBinXML(input, convert_illegal_things=args.convert_illegal)
|
xml = KBinXML(input, convert_illegal_things=args.convert_illegal)
|
||||||
stdout = getattr(sys.stdout, "buffer", sys.stdout)
|
stdout = getattr(sys.stdout, "buffer", sys.stdout)
|
||||||
if KBinXML.is_binary_xml(input):
|
try:
|
||||||
stdout.write(xml.to_text().encode("utf-8"))
|
if KBinXML.is_binary_xml(input):
|
||||||
else:
|
stdout.write(xml.to_text().encode("utf-8"))
|
||||||
stdout.write(xml.to_binary())
|
else:
|
||||||
|
stdout.write(xml.to_binary())
|
||||||
|
except BrokenPipeError:
|
||||||
|
# allows kbinxml to be piped to `head` or similar
|
||||||
|
sys.exit(141)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
3
setup.py
3
setup.py
|
|
@ -1,13 +1,12 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
requires = [
|
requires = [
|
||||||
"lxml",
|
"lxml",
|
||||||
]
|
]
|
||||||
|
|
||||||
python_requires = ">=3.10"
|
python_requires = ">=3.10"
|
||||||
|
|
||||||
version = "2.0"
|
version = "2.1"
|
||||||
setup(
|
setup(
|
||||||
name="kbinxml",
|
name="kbinxml",
|
||||||
description="Decoder/encoder for Konami's binary XML format",
|
description="Decoder/encoder for Konami's binary XML format",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user