-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Decompollaborate/develop
2.0.0
Showing
15 changed files
with
456 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-FileCopyrightText: © 2022 Decompollaborate | ||
# SPDX-FileCopyrightText: © 2022-2023 Decompollaborate | ||
# SPDX-License-Identifier: MIT | ||
|
||
from __future__ import annotations | ||
|
||
__version_info__ = (1, 2, 1) | ||
__version_info__ = (2, 0, 0) | ||
__version__ = ".".join(map(str, __version_info__)) | ||
__author__ = "Decompollaborate" | ||
|
||
from . import utils | ||
from . import utils as utils | ||
|
||
from .mapfile import MapFile | ||
from .mapfile import Symbol, File, FoundSymbolInfo | ||
from .mapfile import MapFile as MapFile | ||
from .mapfile import Symbol as Symbol | ||
from .mapfile import File as File | ||
from .mapfile import Segment as Segment | ||
from .mapfile import FoundSymbolInfo as FoundSymbolInfo | ||
|
||
from .progress_stats import ProgressStats | ||
from .progress_stats import ProgressStats as ProgressStats | ||
|
||
from . import frontends | ||
from . import frontends as frontends |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-FileCopyrightText: © 2022 Decompollaborate | ||
# SPDX-FileCopyrightText: © 2022-2023 Decompollaborate | ||
# SPDX-License-Identifier: MIT | ||
|
||
from __future__ import annotations | ||
|
||
|
||
from . import first_diff | ||
from . import pj64_syms | ||
from . import progress | ||
from . import sym_info | ||
from . import symbol_sizes_csv | ||
from . import upload_frogress | ||
from . import first_diff as first_diff | ||
from . import jsonify as jsonify | ||
from . import pj64_syms as pj64_syms | ||
from . import progress as progress | ||
from . import sym_info as sym_info | ||
from . import symbol_sizes_csv as symbol_sizes_csv | ||
from . import upload_frogress as upload_frogress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-FileCopyrightText: © 2022-2023 Decompollaborate | ||
# SPDX-License-Identifier: MIT | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
import json | ||
from pathlib import Path | ||
|
||
from .. import mapfile | ||
|
||
|
||
def doJsonify(mapPath: Path, outputPath: Path|None) -> int: | ||
mapFile = mapfile.MapFile() | ||
mapFile.readMapFile(mapPath) | ||
|
||
jsonStr = json.dumps(mapFile.toJson(), indent=4) | ||
|
||
if outputPath is None: | ||
print(jsonStr) | ||
else: | ||
outputPath.parent.mkdir(parents=True, exist_ok=True) | ||
outputPath.write_text(jsonStr) | ||
|
||
return 0 | ||
|
||
|
||
def processArguments(args: argparse.Namespace): | ||
mapPath: Path = args.mapfile | ||
outputPath: Path|None = Path(args.output) if args.output is not None else None | ||
|
||
exit(doJsonify(mapPath, outputPath)) | ||
|
||
def addSubparser(subparser: argparse._SubParsersAction[argparse.ArgumentParser]): | ||
parser = subparser.add_parser("jsonify", help="Converts a mapfile into a json format.") | ||
|
||
parser.add_argument("mapfile", help="Path to a map file", type=Path) | ||
parser.add_argument("-o", "--output", help="Output path of for the generated json. If omitted then stdout is used instead.") | ||
|
||
parser.set_defaults(func=processArguments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.