feat: init repo

This commit is contained in:
Halyul
2021-05-26 02:24:18 -04:00
commit 880d638a8f
34 changed files with 602791 additions and 0 deletions

30
lib/atlas_reader.py Normal file
View File

@@ -0,0 +1,30 @@
import pathlib
import shutil
class AtlasReader:
def __init__(self, file_path: str, save_path: str) -> None:
if file_path.strip().endswith(".atlas") is False:
file_path += ".atlas"
if save_path.strip().endswith(".atlas") is False:
save_path += ".atlas"
self.file_path = pathlib.Path.cwd().joinpath(file_path)
self.save_path = pathlib.Path.cwd().joinpath(save_path)
self.images = list()
def get_images(self):
with open(self.file_path, "r") as f:
line = f.readline()
while line:
line = line.strip()
if line.endswith(".png") is True:
self.images.append(line)
line = f.readline()
self.copy()
def copy(self):
shutil.copyfile(
self.file_path,
self.save_path
)