mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2024-11-11 01:27:35 +08:00
Merge branch 'master' of https://gitee.com/EillesWan/Musicreater
This commit is contained in:
commit
5d48fcd96a
@ -81,7 +81,7 @@ class NotDefineTempoError(MidiFormatException):
|
|||||||
class ChannelOverFlowError(MidiFormatException):
|
class ChannelOverFlowError(MidiFormatException):
|
||||||
"""一个midi中含有过多的通道"""
|
"""一个midi中含有过多的通道"""
|
||||||
|
|
||||||
def __init__(self, max_channel = 16, *args):
|
def __init__(self, max_channel=16, *args):
|
||||||
"""一个midi中含有过多的通道"""
|
"""一个midi中含有过多的通道"""
|
||||||
super().__init__("含有过多的通道(数量应≤{})".format(max_channel), *args)
|
super().__init__("含有过多的通道(数量应≤{})".format(max_channel), *args)
|
||||||
|
|
||||||
|
@ -20,17 +20,17 @@ Copyright © 2023 all the developers of Musicreater
|
|||||||
Terms & Conditions: ../License.md
|
Terms & Conditions: ../License.md
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import mido
|
|
||||||
import brotli
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
|
||||||
import shutil
|
import shutil
|
||||||
|
import uuid
|
||||||
|
from typing import TypeVar, Union
|
||||||
|
|
||||||
|
import brotli
|
||||||
|
import mido
|
||||||
|
|
||||||
from .utils import *
|
|
||||||
from .exceptions import *
|
from .exceptions import *
|
||||||
from .instConstants import *
|
from .instConstants import *
|
||||||
|
from .utils import *
|
||||||
from typing import TypeVar, Union
|
|
||||||
|
|
||||||
T = TypeVar("T") # Declare type variable
|
T = TypeVar("T") # Declare type variable
|
||||||
VM = TypeVar("VM", mido.MidiFile, None) # void mido
|
VM = TypeVar("VM", mido.MidiFile, None) # void mido
|
||||||
@ -1744,11 +1744,11 @@ class midiConvert:
|
|||||||
del struct_a, pgb_struct
|
del struct_a, pgb_struct
|
||||||
|
|
||||||
index_file.write(
|
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(
|
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:
|
else:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
from typing import Union
|
|
||||||
from TrimMCStruct import Structure, Block, TAG_Long, TAG_Byte
|
from TrimMCStruct import Structure, Block, TAG_Long, TAG_Byte
|
||||||
|
|
||||||
bdx_key = {
|
bdx_key = {
|
||||||
@ -280,6 +280,7 @@ def form_repeater_in_NBT_struct(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def form_command_block_in_NBT_struct(
|
def form_command_block_in_NBT_struct(
|
||||||
command: str,
|
command: str,
|
||||||
coordinate: tuple,
|
coordinate: tuple,
|
||||||
@ -372,6 +373,7 @@ def form_command_block_in_NBT_struct(
|
|||||||
compability_version=17959425,
|
compability_version=17959425,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def commands_to_structure(
|
def commands_to_structure(
|
||||||
commands: list,
|
commands: list,
|
||||||
max_height: int = 64,
|
max_height: int = 64,
|
||||||
@ -452,4 +454,3 @@ def commands_to_structure(
|
|||||||
),
|
),
|
||||||
(now_x, now_y, now_z),
|
(now_x, now_y, now_z),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,30 +1,22 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
|
from rich.console import Console
|
||||||
|
from rich.progress import track
|
||||||
|
|
||||||
|
console = Console()
|
||||||
|
|
||||||
|
|
||||||
# find the full path of .egg-info folder
|
def main():
|
||||||
egg_info = [i for i in os.listdir() if i.endswith(".egg-info")][0]
|
with console.status("Find the full path of .egg-info folder"):
|
||||||
print(egg_info)
|
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:
|
if __name__ == "__main__":
|
||||||
shutil.rmtree("dist")
|
main()
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
shutil.rmtree(egg_info)
|
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
shutil.rmtree("logs")
|
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
print("Cleaned up!")
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
python setup.py sdist bdist_wheel
|
python -m build
|
||||||
python -m twine upload dist/*
|
python -m twine upload dist/*
|
||||||
python clean_update.py
|
python clean_update.py
|
||||||
|
Loading…
Reference in New Issue
Block a user