This commit is contained in:
EillesWan 2023-04-29 21:32:16 +08:00
commit 5d48fcd96a
6 changed files with 260 additions and 263 deletions

View File

@ -81,7 +81,7 @@ class NotDefineTempoError(MidiFormatException):
class ChannelOverFlowError(MidiFormatException):
"""一个midi中含有过多的通道"""
def __init__(self, max_channel = 16, *args):
def __init__(self, max_channel=16, *args):
"""一个midi中含有过多的通道"""
super().__init__("含有过多的通道(数量应≤{}".format(max_channel), *args)

View File

@ -20,17 +20,17 @@ Copyright © 2023 all the developers of Musicreater
Terms & Conditions: ../License.md
"""
import mido
import brotli
import json
import uuid
import shutil
import uuid
from typing import TypeVar, Union
import brotli
import mido
from .utils import *
from .exceptions import *
from .instConstants import *
from typing import TypeVar, Union
from .utils import *
T = TypeVar("T") # Declare type variable
VM = TypeVar("VM", mido.MidiFile, None) # void mido
@ -1744,11 +1744,11 @@ class midiConvert:
del struct_a, pgb_struct
index_file.write(
f"structure load {self.mid_file_name}_reset ~{pgbSize[0]+2} ~ ~1\n"
f"structure load {self.mid_file_name}_reset ~{pgbSize[0] + 2} ~ ~1\n"
)
index_file.write(
f"structure load {self.mid_file_name}_main ~{pgbSize[0]+2} ~1 ~1\n"
f"structure load {self.mid_file_name}_main ~{pgbSize[0] + 2} ~1 ~1\n"
)
else:

View File

@ -1,6 +1,6 @@
import math
import os
from typing import Union
from TrimMCStruct import Structure, Block, TAG_Long, TAG_Byte
bdx_key = {
@ -280,6 +280,7 @@ def form_repeater_in_NBT_struct(
},
)
def form_command_block_in_NBT_struct(
command: str,
coordinate: tuple,
@ -372,6 +373,7 @@ def form_command_block_in_NBT_struct(
compability_version=17959425,
)
def commands_to_structure(
commands: list,
max_height: int = 64,
@ -452,4 +454,3 @@ def commands_to_structure(
),
(now_x, now_y, now_z),
)

View File

@ -1,30 +1,22 @@
import shutil
import os
from rich.console import Console
from rich.progress import track
console = Console()
# find the full path of .egg-info folder
egg_info = [i for i in os.listdir() if i.endswith(".egg-info")][0]
print(egg_info)
def main():
with console.status("Find the full path of .egg-info folder"):
egg_info: list = []
for file in os.listdir():
if os.path.isfile(file) and file.endswith(".egg-info"):
egg_info.append(file)
console.print(file)
for file in track(["build", "dist", "logs", *egg_info], description="Deleting files"):
if os.path.isdir(file) and os.access(file, os.W_OK):
shutil.rmtree(file)
# remove build, dist, logs, TrimLog.egg-info folders
try:
shutil.rmtree("build")
except FileNotFoundError:
pass
try:
shutil.rmtree("dist")
except FileNotFoundError:
pass
try:
shutil.rmtree(egg_info)
except FileNotFoundError:
pass
try:
shutil.rmtree("logs")
except FileNotFoundError:
pass
print("Cleaned up!")
if __name__ == "__main__":
main()

View File

@ -1,3 +1,3 @@
python setup.py sdist bdist_wheel
python -m build
python -m twine upload dist/*
python clean_update.py

4
upload.sh Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
python -m build
python -m twine upload dist/*
python clean_update.py