add: album
This commit is contained in:
parent
b4a78a9e7d
commit
3f30154b36
@ -39,6 +39,5 @@ python3 src/main.py %site location%
|
||||
|
||||
### Futur update
|
||||
- add gimp profile file
|
||||
- album
|
||||
- unrepertoried page
|
||||
- add audio file on page
|
@ -31,6 +31,9 @@ class Path():
|
||||
return None
|
||||
return self._name
|
||||
|
||||
def touch(self) -> None:
|
||||
open(self.get_absolute_path(), "w+").close()
|
||||
|
||||
def create(self) -> None:
|
||||
os.makedirs(self.get_absolute_path())
|
||||
|
||||
|
@ -14,13 +14,22 @@ if TYPE_CHECKING:
|
||||
from album import Album
|
||||
|
||||
class Picture():
|
||||
def __init__(self, picture_path: Path, page = None, raw: Path|None = None, albums_name: list[str] = None, is_repertoried: bool = True):
|
||||
def __init__(self, picture_path: Path, page = None, raw: Path|None = None, is_repertoried: bool = True):
|
||||
self._large: Path = picture_path
|
||||
self._small: Path = Path(picture_path.get_absolute_path()[:-4] + "_small.jpg")
|
||||
self._profile_file: Path = Path(picture_path.get_absolute_path() + ".out.pp3")
|
||||
self._albums_file: Path = Path(picture_path.get_absolute_path()[:-4] + "_albums.txt")
|
||||
self._raw: Path|None = raw
|
||||
self._page: Page = page
|
||||
self._albums_name: list[str] = albums_name or []
|
||||
self._albums_name: list[str] = []
|
||||
if self._albums_file.exist():
|
||||
with open(self._albums_file.get_absolute_path(), "r+") as f:
|
||||
albums_name: list[str] = f.read()
|
||||
if (len(albums_name)):
|
||||
self._albums_name += albums_name.split("\n")
|
||||
print(self._albums_name)
|
||||
else:
|
||||
self._albums_file.touch()
|
||||
if (config.CREATE_GENERAL_ALBUM):
|
||||
self._albums_name.append("general")
|
||||
self._is_reperoried: bool = is_repertoried
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="album.css">
|
||||
<link rel="stylesheet" href="/album.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user