mirror of
https://github.com/mon/kbinxml.git
synced 2026-03-31 22:54:31 -05:00
Compare commits
No commits in common. "master" and "2.0" have entirely different histories.
|
|
@ -1,14 +1,14 @@
|
||||||
import argparse
|
import argparse
|
||||||
import operator
|
|
||||||
import sys
|
|
||||||
from io import BytesIO
|
|
||||||
from struct import calcsize
|
from struct import calcsize
|
||||||
|
import sys
|
||||||
|
import operator
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
import lxml.etree as etree
|
import lxml.etree as etree
|
||||||
|
|
||||||
from .bytebuffer import ByteBuffer
|
from .bytebuffer import ByteBuffer
|
||||||
from .format_ids import xml_formats, xml_types
|
|
||||||
from .sixbit import pack_sixbit, unpack_sixbit
|
from .sixbit import pack_sixbit, unpack_sixbit
|
||||||
|
from .format_ids import xml_formats, xml_types
|
||||||
|
|
||||||
DEBUG_OFFSETS = False
|
DEBUG_OFFSETS = False
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
|
|
@ -479,14 +479,10 @@ 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)
|
||||||
try:
|
if KBinXML.is_binary_xml(input):
|
||||||
if KBinXML.is_binary_xml(input):
|
stdout.write(xml.to_text().encode("utf-8"))
|
||||||
stdout.write(xml.to_text().encode("utf-8"))
|
else:
|
||||||
else:
|
stdout.write(xml.to_binary())
|
||||||
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,12 +1,13 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
requires = [
|
requires = [
|
||||||
"lxml",
|
"lxml",
|
||||||
]
|
]
|
||||||
|
|
||||||
python_requires = ">=3.10"
|
python_requires = ">=3.10"
|
||||||
|
|
||||||
version = "2.1"
|
version = "2.0"
|
||||||
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