Compare commits
2 commits
626eaae5e2
...
85f1c3776f
Author | SHA1 | Date | |
---|---|---|---|
85f1c3776f | |||
d4092b46df |
9 changed files with 28 additions and 39 deletions
|
@ -5,12 +5,12 @@ mkdir output
|
|||
mkdir output\bin
|
||||
python -m pip install -r requirements.txt || goto :exit
|
||||
python -m pip install Nuitka || goto :exit
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=vnrecode vnrecode\__main__.py || goto :exit
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=vnrecode vnrecode || goto :exit
|
||||
xcopy vnrecode\vnrecode.toml output\bin /Y
|
||||
move /Y output\vnrecode.exe output\bin
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=unrenapk unrenapk\__main__.py || goto :exit
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=unrenapk unrenapk || goto :exit
|
||||
move /Y output\unrenapk.exe output\bin
|
||||
python -m nuitka --jobs=%NUMBER_OF_PROCESSORS% --output-dir=output --follow-imports --onefile --output-filename=vnds2renpy vnds2renpy/__main__.py || 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
|
||||
echo "Done! You can get binaries into output\bin directory"
|
||||
|
||||
|
|
6
build.sh
6
build.sh
|
@ -14,11 +14,11 @@ case "$(uname -s)" in
|
|||
Linux*) jobs="--jobs=$(nproc)";;
|
||||
Darwin*) jobs="--jobs=$(sysctl -n hw.ncpu)";;
|
||||
esac
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnrecode vnrecode/__main__.py
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnrecode vnrecode
|
||||
cp vnrecode/vnrecode.toml output/bin
|
||||
mv output/vnrecode output/bin
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=unrenapk unrenapk/__main__.py
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=unrenapk unrenapk
|
||||
mv output/unrenapk output/bin
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnds2renpy vnds2renpy/__main__.py
|
||||
python3 -m nuitka "${jobs}" --output-dir=output --onefile --follow-imports --output-filename=vnds2renpy vnds2renpy
|
||||
mv output/vnds2renpy output/bin
|
||||
echo "Done! You can get binaries into output/bin directory"
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from . import application
|
||||
from unrenapk import application
|
||||
|
||||
if __name__ == '__main__':
|
||||
application.launch()
|
||||
|
|
|
@ -3,7 +3,7 @@ from PIL import Image
|
|||
import shutil
|
||||
import os
|
||||
|
||||
from .printer import Printer
|
||||
from unrenapk.printer import Printer
|
||||
|
||||
|
||||
class Extract:
|
||||
|
|
|
@ -4,8 +4,8 @@ import argparse
|
|||
import sys
|
||||
import os
|
||||
|
||||
from .printer import Printer
|
||||
from .actions import Actions
|
||||
from unrenapk.printer import Printer
|
||||
from unrenapk.actions import Actions
|
||||
|
||||
|
||||
def args_init():
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
from .application import Application
|
||||
from .compress import Compress
|
||||
from .printer import Printer
|
||||
from .params import Params
|
||||
from .utils import Utils
|
||||
from vnrecode.application import Application
|
||||
from vnrecode.compress import Compress
|
||||
from vnrecode.printer import Printer
|
||||
from vnrecode.params import Params
|
||||
from vnrecode.utils import Utils
|
||||
|
||||
|
||||
def init():
|
||||
|
|
|
@ -5,10 +5,10 @@ from pathlib import Path
|
|||
import shutil
|
||||
import os
|
||||
|
||||
from .compress import Compress
|
||||
from .printer import Printer
|
||||
from .params import Params
|
||||
from .utils import Utils
|
||||
from vnrecode.compress import Compress
|
||||
from vnrecode.printer import Printer
|
||||
from vnrecode.params import Params
|
||||
from vnrecode.utils import Utils
|
||||
|
||||
|
||||
class Application:
|
||||
|
|
|
@ -3,9 +3,9 @@ from pathlib import Path
|
|||
from PIL import Image
|
||||
import pillow_avif
|
||||
|
||||
from .printer import Printer
|
||||
from .params import Params
|
||||
from .utils import Utils
|
||||
from vnrecode.printer import Printer
|
||||
from vnrecode.params import Params
|
||||
from vnrecode.utils import Utils
|
||||
|
||||
|
||||
class File:
|
||||
|
|
|
@ -3,7 +3,6 @@ from pathlib import Path
|
|||
import colorama
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
|
||||
class Printer:
|
||||
"""
|
||||
|
@ -20,16 +19,6 @@ class Printer:
|
|||
self.bar = IncrementalBar('Compressing', max=file_count, suffix='[%(index)d/%(max)d] (%(percent).1f%%)')
|
||||
self.bar.update()
|
||||
|
||||
@staticmethod
|
||||
def clean_str(string: str) -> str:
|
||||
"""
|
||||
Method fills end of string with spaces to remove progress bar garbage from console
|
||||
:param string: String to "clean"
|
||||
:return: "Clean" string
|
||||
"""
|
||||
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
|
||||
return string + " " * (os.get_terminal_size().columns - len(ansi_escape.sub('', string)))
|
||||
|
||||
@staticmethod
|
||||
def win_ascii_esc():
|
||||
"""
|
||||
|
@ -54,7 +43,7 @@ class Printer:
|
|||
:param string: String to print
|
||||
:return: None
|
||||
"""
|
||||
self.bar_print(self.clean_str(f"\r\033[100m- {string}\033[49m"))
|
||||
self.bar_print(f"\x1b[2K\r\033[100m- {string}\033[49m")
|
||||
|
||||
def warning(self, string: str):
|
||||
"""
|
||||
|
@ -62,7 +51,7 @@ class Printer:
|
|||
:param string: String to print
|
||||
:return: None
|
||||
"""
|
||||
self.bar_print(self.clean_str(f"\r\033[93m!\033[0m {string}\033[49m"))
|
||||
self.bar_print(f"\x1b[2K\r\033[93m!\033[0m {string}\033[49m")
|
||||
|
||||
def error(self, string: str):
|
||||
"""
|
||||
|
@ -70,7 +59,7 @@ class Printer:
|
|||
:param string: String to print
|
||||
:return: None
|
||||
"""
|
||||
self.bar_print(self.clean_str(f"\r\033[31m\u2715\033[0m {string}\033[49m"))
|
||||
self.bar_print(f"\x1b[2K\r\033[31m\u2715\033[0m {string}\033[49m")
|
||||
|
||||
def files(self, source_path: Path, output_path: Path, comment: str):
|
||||
"""
|
||||
|
@ -81,8 +70,8 @@ class Printer:
|
|||
:param comment: Comment about recode quality setting
|
||||
:return: None
|
||||
"""
|
||||
self.bar_print(self.clean_str(f"\r\033[0;32m\u2713\033[0m \033[0;37m{source_path.stem}\033[0m{source_path.suffix}\033[0;37m -> "
|
||||
f"{source_path.stem}\033[0m{output_path.suffix}\033[0;37m ({comment})\033[0m"))
|
||||
self.bar_print(f"\x1b[2K\r\033[0;32m\u2713\033[0m \033[0;37m{source_path.stem}\033[0m{source_path.suffix}\033[0;37m -> "
|
||||
f"{source_path.stem}\033[0m{output_path.suffix}\033[0;37m ({comment})\033[0m")
|
||||
|
||||
def unknown_file(self, filename: str):
|
||||
"""
|
||||
|
@ -90,4 +79,4 @@ class Printer:
|
|||
:param filename: Name of unknown file
|
||||
:return:
|
||||
"""
|
||||
self.bar_print(self.clean_str(f"\r\u2713 \033[0;33m{filename}\033[0m (File will be force compressed via ffmpeg)"))
|
||||
self.bar_print(f"\x1b[2K\r\u2713 \033[0;33m{filename}\033[0m (File will be force compressed via ffmpeg)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue