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
|
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
|
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
|
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"
|
echo "Done! You can get binaries into output\bin directory"
|
||||||
|
|
||||||
:venv_error
|
: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
|
mv output/unrenapk output/bin
|
||||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnds2renpy vnds2renpy
|
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnds2renpy vnds2renpy
|
||||||
mv output/vnds2renpy output/bin
|
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"
|
echo "Done! You can get binaries into output/bin directory"
|
|
@ -5,18 +5,20 @@ requires = [
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
packages = ["vnrecode", "unrenapk", "vnds2renpy"]
|
packages = ["vnrecode", "unrenapk", "vnds2renpy", "rpatool"]
|
||||||
include-package-data = true
|
include-package-data = true
|
||||||
|
|
||||||
[tool.setuptools.package-data]
|
[tool.setuptools.package-data]
|
||||||
'vnrecode' = ['*.py']
|
'vnrecode' = ['*.py']
|
||||||
'vnds2renpy' = ['*.py']
|
'vnds2renpy' = ['*.py']
|
||||||
'unrenapk' = ['*.py']
|
'unrenapk' = ['*.py']
|
||||||
|
'rpatool' = ['*.py']
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
vnrecode = "vnrecode.__main__:init"
|
vnrecode = "vnrecode.__main__:init"
|
||||||
vnds2renpy = "vnds2renpy.__main__:main"
|
vnds2renpy = "vnds2renpy.__main__:main"
|
||||||
unrenapk = "unrenapk.application:launch"
|
unrenapk = "unrenapk.application:launch"
|
||||||
|
rpatool = "rpatool.rpatool:main"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "vntools"
|
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
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import codecs
|
import codecs
|
||||||
import pickle
|
|
||||||
import errno
|
import errno
|
||||||
import random
|
import random
|
||||||
try:
|
try:
|
||||||
|
@ -39,6 +37,7 @@ if sys.version_info[0] >= 3:
|
||||||
def _unpickle(data):
|
def _unpickle(data):
|
||||||
# Specify latin1 encoding to prevent raw byte values from causing an ASCII decode error.
|
# Specify latin1 encoding to prevent raw byte values from causing an ASCII decode error.
|
||||||
return pickle.loads(data, encoding='latin1')
|
return pickle.loads(data, encoding='latin1')
|
||||||
|
|
||||||
elif sys.version_info[0] == 2:
|
elif sys.version_info[0] == 2:
|
||||||
def _unicode(text):
|
def _unicode(text):
|
||||||
if isinstance(text, unicode):
|
if isinstance(text, unicode):
|
||||||
|
@ -162,7 +161,6 @@ class RenPyArchive:
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
|
|
||||||
# List files in archive and current internal storage.
|
# List files in archive and current internal storage.
|
||||||
def list(self):
|
def list(self):
|
||||||
return list(self.indexes.keys()) + list(self.files.keys())
|
return list(self.indexes.keys()) + list(self.files.keys())
|
||||||
|
@ -304,7 +302,8 @@ class RenPyArchive:
|
||||||
# Reload the file in our internal database.
|
# Reload the file in our internal database.
|
||||||
self.load(filename)
|
self.load(filename)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
def main():
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
@ -490,3 +489,6 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
print('No operation specified :(')
|
print('No operation specified :(')
|
||||||
print('Use {} --help for usage details.'.format(sys.argv[0]))
|
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