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):
|
||||
"""一个midi中含有过多的通道"""
|
||||
|
||||
def __init__(self, max_channel = 16, *args):
|
||||
def __init__(self, max_channel=16, *args):
|
||||
"""一个midi中含有过多的通道"""
|
||||
super().__init__("含有过多的通道(数量应≤{})".format(max_channel), *args)
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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),
|
||||
)
|
||||
|
||||
|
@ -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()
|
||||
|
@ -1,3 +1,3 @@
|
||||
python setup.py sdist bdist_wheel
|
||||
python -m build
|
||||
python -m twine upload dist/*
|
||||
python clean_update.py
|
||||
|
Loading…
Reference in New Issue
Block a user