1
0
mirror of synced 2024-11-23 22:10:59 +01:00

Update read.py to support possibly scraping from multiple different data releases given a single version.

This commit is contained in:
Jennifer Taylor 2023-07-29 20:37:25 +00:00
parent 6fceca6adc
commit a794b124f4
26 changed files with 403 additions and 273 deletions

View File

@ -5,6 +5,7 @@ if __name__ == "__main__":
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module("bemani.utils.twodxutils", run_name="__main__") runpy.run_module("bemani.utils.twodxutils", run_name="__main__")

View File

@ -607,7 +607,15 @@ Then, run the following command, modifying the version parameter as required.
For Reflec Beat, get the game DLL from the version of the game you want to import and For Reflec Beat, get the game DLL from the version of the game you want to import and
run a command like so. This network supports Reflec Beat up through Volzza 2, so you run a command like so. This network supports Reflec Beat up through Volzza 2, so you
will want to run this with versions 1-6 to completely initialize: will want to run this with versions 1-6 to completely initialize. Use the version
corresponding to version in the following table:
* Reflec Beat: 1
* Limelight: 2
* Colette: 3
* Groovin'!!: 4
* VOLZZA: 5
* VOLZZA 2: 6
``` ```
./read --config config/server.yaml --series reflec --version 1 --bin reflecbeat.dll ./read --config config/server.yaml --series reflec --version 1 --bin reflecbeat.dll

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
api
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -71,6 +71,18 @@ class RetException(Exception):
pass pass
class InvalidOffsetException(Exception):
pass
class InvalidVirtualOffsetException(InvalidOffsetException):
pass
class InvalidPhysicalOffsetException(InvalidOffsetException):
pass
class PEFile: class PEFile:
def __init__(self, data: bytes) -> None: def __init__(self, data: bytes) -> None:
self.data = data self.data = data
@ -89,7 +101,7 @@ class PEFile:
if offset == virtual: if offset == virtual:
return physical return physical
raise Exception( raise InvalidVirtualOffsetException(
f"Couldn't find physical offset for virtual offset 0x{offset:08x}" f"Couldn't find physical offset for virtual offset 0x{offset:08x}"
) )
@ -109,7 +121,7 @@ class PEFile:
if offset == physical: if offset == physical:
return virtual return virtual
raise Exception( raise InvalidPhysicalOffsetException(
f"Couldn't find virtual offset for physical offset 0x{offset:08x}" f"Couldn't find virtual offset for physical offset 0x{offset:08x}"
) )

View File

@ -1713,7 +1713,6 @@ class ImportJubeat(ImportBase):
VersionConstants.JUBEAT_FESTO, VersionConstants.JUBEAT_FESTO,
}: }:
for emblem_entry in root.find("emblem_list") or []: for emblem_entry in root.find("emblem_list") or []:
print(emblem_entry)
index = int(emblem_entry.find("index").text) index = int(emblem_entry.find("index").text)
layer = int(emblem_entry.find("layer").text) layer = int(emblem_entry.find("layer").text)
music_id = int(emblem_entry.find("music_id").text) music_id = int(emblem_entry.find("music_id").text)
@ -3775,6 +3774,37 @@ class ImportMuseca(ImportBase):
self.finish_batch() self.finish_batch()
class ReflecBeatScrapeConfiguration:
def __init__(
self,
*,
version: str,
offset: int,
stride: int,
max_songs: int,
max_difficulties: int,
song_offset: int,
song_length: int,
artist_offset: Optional[int],
artist_length: Optional[int],
chart_offset: int,
chart_length: int,
difficulties_offset: int,
) -> None:
self.version = version
self.offset = offset
self.stride = stride
self.max_songs = max_songs
self.max_difficulties = max_difficulties
self.song_offset = song_offset
self.song_length = song_length
self.artist_offset = artist_offset
self.artist_length = artist_length
self.chart_offset = chart_offset
self.chart_length = chart_length
self.difficulties_offset = difficulties_offset
class ImportReflecBeat(ImportBase): class ImportReflecBeat(ImportBase):
def __init__( def __init__(
self, self,
@ -3810,92 +3840,117 @@ class ImportReflecBeat(ImportBase):
data = myfile.read() data = myfile.read()
myfile.close() myfile.close()
configurations: List[ReflecBeatScrapeConfiguration] = []
if self.version == VersionConstants.REFLEC_BEAT: if self.version == VersionConstants.REFLEC_BEAT:
# Based on KBR:A:A:A:2011112300 # Based on KBR:A:A:A:2011112300
offset = 0xBFBD0 configurations.append(
stride = 280 ReflecBeatScrapeConfiguration(
max_songs = 93 version="KBR:A:A:A:2011112300",
max_difficulties = 3 offset=0xBFBD0,
stride=280,
song_offset = 0x4C max_songs=93,
song_length = 0x40 max_difficulties=3,
# Artists aren't included in this mix. song_offset=0x4C,
artist_offset = None song_length=0x40,
artist_length = None # Artists aren't included in this mix.
chart_offset = 0xD5 artist_offset=None,
chart_length = 0x20 artist_length=None,
difficulties_offset = 0xD2 chart_offset=0xD5,
chart_length=0x20,
difficulties_offset=0xD2,
)
)
elif self.version == VersionConstants.REFLEC_BEAT_LIMELIGHT: elif self.version == VersionConstants.REFLEC_BEAT_LIMELIGHT:
# Based on LBR:A:A:A:2012082900 # Based on LBR:A:A:A:2012082900
offset = 0x132C48 configurations.append(
stride = 220 ReflecBeatScrapeConfiguration(
max_songs = 191 version="LBR:A:A:A:2012082900",
max_difficulties = 3 offset=0x132C48,
stride=220,
song_offset = 0x4C max_songs=191,
song_length = 0x40 max_difficulties=3,
# Artists aren't included in this mix. song_offset=0x4C,
artist_offset = None song_length=0x40,
artist_length = None # Artists aren't included in this mix.
chart_offset = 0x9B artist_offset=None,
chart_length = 0x20 artist_length=None,
difficulties_offset = 0x98 chart_offset=0x9B,
chart_length=0x20,
difficulties_offset=0x98,
)
)
elif self.version == VersionConstants.REFLEC_BEAT_COLETTE: elif self.version == VersionConstants.REFLEC_BEAT_COLETTE:
# Based on MBR:J:A:A:2014011600 # Based on MBR:J:A:A:2014011600
offset = 0x1E6880 configurations.append(
stride = 468 ReflecBeatScrapeConfiguration(
max_songs = 443 version="MBR:J:A:A:2014011600",
max_difficulties = 3 offset=0x1E6880,
stride=468,
song_offset = 0x34 max_songs=443,
song_length = 0x80 max_difficulties=3,
artist_offset = 0xB4 song_offset=0x34,
artist_length = 0x80 song_length=0x80,
chart_offset = 0x1B4 artist_offset=0xB4,
chart_length = 0x20 artist_length=0x80,
difficulties_offset = 0x1A8 chart_offset=0x1B4,
chart_length=0x20,
difficulties_offset=0x1A8,
)
)
elif self.version == VersionConstants.REFLEC_BEAT_GROOVIN: elif self.version == VersionConstants.REFLEC_BEAT_GROOVIN:
# Based on MBR:J:A:A:2015102100 # Based on MBR:J:A:A:2015102100
offset = 0x212EC0 configurations.append(
stride = 524 ReflecBeatScrapeConfiguration(
max_songs = 698 version="MBR:J:A:A:2015102100",
max_difficulties = 4 offset=0x212EC0,
stride=524,
song_offset = 0x3C max_songs=698,
song_length = 0x80 max_difficulties=4,
artist_offset = 0xBC song_offset=0x3C,
artist_length = 0x80 song_length=0x80,
chart_offset = 0x1E8 artist_offset=0xBC,
chart_length = 0x20 artist_length=0x80,
difficulties_offset = 0x1D0 chart_offset=0x1E8,
chart_length=0x20,
difficulties_offset=0x1D0,
)
)
elif self.version == VersionConstants.REFLEC_BEAT_VOLZZA: elif self.version == VersionConstants.REFLEC_BEAT_VOLZZA:
# Based on MBR:J:A:A:2016030200 # Based on MBR:J:A:A:2016030200
offset = 0x1A0EC8 configurations.append(
stride = 552 ReflecBeatScrapeConfiguration(
max_songs = 805 version="MBR:J:A:A:2016030200",
max_difficulties = 4 offset=0x1A0EC8,
stride=552,
song_offset = 0x38 max_songs=805,
song_length = 0x80 max_difficulties=4,
artist_offset = 0xB8 song_offset=0x38,
artist_length = 0x80 song_length=0x80,
chart_offset = 0x1E4 artist_offset=0xB8,
chart_length = 0x20 artist_length=0x80,
difficulties_offset = 0x1CC chart_offset=0x1E4,
chart_length=0x20,
difficulties_offset=0x1CC,
)
)
elif self.version == VersionConstants.REFLEC_BEAT_VOLZZA_2: elif self.version == VersionConstants.REFLEC_BEAT_VOLZZA_2:
# Based on MBR:J:A:A:2016100400 # Based on MBR:J:A:A:2016100400
offset = 0x1CBC68 configurations.append(
stride = 552 ReflecBeatScrapeConfiguration(
max_songs = 850 version="MBR:J:A:A:2016100400",
max_difficulties = 4 offset=0x1CBC68,
stride=552,
song_offset = 0x38 max_songs=850,
song_length = 0x80 max_difficulties=4,
artist_offset = 0xB8 song_offset=0x38,
artist_length = 0x80 song_length=0x80,
chart_offset = 0x1E4 artist_offset=0xB8,
chart_length = 0x20 artist_length=0x80,
difficulties_offset = 0x1CC chart_offset=0x1E4,
chart_length=0x20,
difficulties_offset=0x1CC,
)
)
else: else:
raise Exception(f"Unsupported ReflecBeat version {self.version}") raise Exception(f"Unsupported ReflecBeat version {self.version}")
@ -3906,7 +3961,7 @@ class ImportReflecBeat(ImportBase):
end = i end = i
break break
if end is None: if end is None:
raise Exception("Invalid string!") raise UnicodeError("Invalid string!")
if end == 0: if end == 0:
return "" return ""
@ -3925,48 +3980,80 @@ class ImportReflecBeat(ImportBase):
return folder return folder
songs = [] for config in configurations:
for i in range(max_songs): try:
start = offset + (stride * i) print(f"Trying configuration for game version {config.version}...")
end = start + stride
songdata = data[start:end]
title = convert_string(songdata[song_offset : (song_offset + song_length)]) songs = []
if artist_offset is None: for i in range(config.max_songs):
artist = "" start = config.offset + (config.stride * i)
else: end = start + config.stride
artist = convert_string( songdata = data[start:end]
songdata[artist_offset : (artist_offset + artist_length)]
)
if title == "" and artist == "":
continue
songid = struct.unpack("<I", songdata[0:4])[0]
chart = convert_string(
songdata[chart_offset : (chart_offset + chart_length)]
)
difficulties = [
d
for d in songdata[
difficulties_offset : (difficulties_offset + max_difficulties)
]
]
difficulties = [0 if d == 255 else d for d in difficulties]
folder = convert_version(songid, int(chart[0]))
while len(difficulties) < 4: title = convert_string(
difficulties.append(0) songdata[
config.song_offset : (
config.song_offset + config.song_length
)
]
)
if config.artist_offset is None:
artist = ""
else:
artist = convert_string(
songdata[
config.artist_offset : (
config.artist_offset + config.artist_length
)
]
)
if title == "" and artist == "":
continue
songid = struct.unpack("<I", songdata[0:4])[0]
chart = convert_string(
songdata[
config.chart_offset : (
config.chart_offset + config.chart_length
)
]
)
difficulties = [
d
for d in songdata[
config.difficulties_offset : (
config.difficulties_offset + config.max_difficulties
)
]
]
difficulties = [0 if d == 255 else d for d in difficulties]
folder = convert_version(songid, int(chart[0]))
songs.append( while len(difficulties) < 4:
{ difficulties.append(0)
"id": songid,
"title": title, songs.append(
"artist": artist, {
"chartid": chart[:4], "id": songid,
"difficulties": difficulties, "title": title,
"folder": folder, "artist": artist,
} "chartid": chart[:4],
) "difficulties": difficulties,
return songs "folder": folder,
}
)
# If we got here, that means we ran into no issues and didn't have to attempt another offset.
print("Successfully parsed game DB!")
return songs
except UnicodeError:
# These offsets are possibly not correct, so try the next configuration.
print("Failed to parse game DB!")
pass
raise Exception(
"Could not determine correct binary parser configuration for ReflecBeat version {self.version}"
)
def lookup(self, server: str, token: str) -> List[Dict[str, Any]]: def lookup(self, server: str, token: str) -> List[Dict[str, Any]]:
# Grab music info from remote server # Grab music info from remote server

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
dbutils
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
jsx
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
proxy
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
psmap
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
read
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
replay
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

15
struct
View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")

View File

@ -1,11 +1,12 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
if __name__ == "__main__": if __name__ == "__main__":
import os import os
path = os.path.abspath(os.path.dirname(__file__)) path = os.path.abspath(os.path.dirname(__file__))
name = os.path.basename(__file__) name = os.path.basename(__file__)
import sys import sys
sys.path.append(path) sys.path.append(path)
os.environ["SQLALCHEMY_SILENCE_UBER_WARNING"] = "1"
import runpy import runpy
runpy.run_module(f"bemani.utils.{name}", run_name="__main__") runpy.run_module(f"bemani.utils.{name}", run_name="__main__")