rpatool: pack as python module and executable
This commit is contained in:
parent
d221c2ca67
commit
0a1b1e17ee
6 changed files with 19 additions and 5 deletions
|
@ -12,6 +12,8 @@ python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-impo
|
|||
move /Y output\unrenapk.exe output\bin
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=vnds2renpy vnds2renpy || goto :exit
|
||||
move /Y output\vnds2renpy.exe output\bin
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=rpatool rpatool || goto :exit
|
||||
move /Y output\rpatool.exe output\bin
|
||||
echo "Done! You can get binaries into output\bin directory"
|
||||
|
||||
:venv_error
|
||||
|
|
2
build.sh
2
build.sh
|
@ -21,4 +21,6 @@ python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --out
|
|||
mv output/unrenapk output/bin
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnds2renpy vnds2renpy
|
||||
mv output/vnds2renpy output/bin
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=rpatool rpatool
|
||||
mv output/rpatool output/bin
|
||||
echo "Done! You can get binaries into output/bin directory"
|
|
@ -5,18 +5,20 @@ requires = [
|
|||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = ["vnrecode", "unrenapk", "vnds2renpy"]
|
||||
packages = ["vnrecode", "unrenapk", "vnds2renpy", "rpatool"]
|
||||
include-package-data = true
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
'vnrecode' = ['*.py']
|
||||
'vnds2renpy' = ['*.py']
|
||||
'unrenapk' = ['*.py']
|
||||
'rpatool' = ['*.py']
|
||||
|
||||
[project.scripts]
|
||||
vnrecode = "vnrecode.__main__:init"
|
||||
vnds2renpy = "vnds2renpy.__main__:main"
|
||||
unrenapk = "unrenapk.application:launch"
|
||||
rpatool = "rpatool.rpatool:main"
|
||||
|
||||
[project]
|
||||
name = "vntools"
|
||||
|
|
0
rpatool/__init__.py
Normal file
0
rpatool/__init__.py
Normal file
6
rpatool/__main__.py
Normal file
6
rpatool/__main__.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from rpatool import rpatool
|
||||
|
||||
if __name__ == '__main__':
|
||||
rpatool.main()
|
|
@ -1,11 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import os
|
||||
import codecs
|
||||
import pickle
|
||||
import errno
|
||||
import random
|
||||
try:
|
||||
|
@ -39,6 +37,7 @@ if sys.version_info[0] >= 3:
|
|||
def _unpickle(data):
|
||||
# Specify latin1 encoding to prevent raw byte values from causing an ASCII decode error.
|
||||
return pickle.loads(data, encoding='latin1')
|
||||
|
||||
elif sys.version_info[0] == 2:
|
||||
def _unicode(text):
|
||||
if isinstance(text, unicode):
|
||||
|
@ -162,7 +161,6 @@ class RenPyArchive:
|
|||
if self.verbose:
|
||||
print(message)
|
||||
|
||||
|
||||
# List files in archive and current internal storage.
|
||||
def list(self):
|
||||
return list(self.indexes.keys()) + list(self.files.keys())
|
||||
|
@ -304,7 +302,8 @@ class RenPyArchive:
|
|||
# Reload the file in our internal database.
|
||||
self.load(filename)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
|
@ -490,3 +489,6 @@ if __name__ == "__main__":
|
|||
else:
|
||||
print('No operation specified :(')
|
||||
print('Use {} --help for usage details.'.format(sys.argv[0]))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue