Skip to content

Commit

Permalink
Add get_name and get_version methods
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoCaracciolo committed Aug 9, 2024
1 parent 4f4c757 commit 5330e90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/livepng/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ class LivePNG:
observers : list[LivePNGModelObserver]
callbackfunctions : list[Callable]

name : str
version : int
styles : dict[str, Style] = {}
current_style : Style
current_expression : Expression
current_variant : Variant
output_type : FilepathOutput
path : str

__speak_lock : Semaphore
__request_interrupt : bool

Expand Down Expand Up @@ -53,6 +56,8 @@ def __init__(self, path: str, output_type:FilepathOutput=FilepathOutput.LOCAL_PA

def load_model(self):
"""Load the model"""
self.version = self.model_info["version"]
self.name = self.model_info["name"]
for style in self.model_info["styles"]:
stl = Style(style, self.model_info["styles"][style]["expressions"])
self.styles[style] = stl
Expand All @@ -64,6 +69,14 @@ def load_defaults(self):
self.current_variant = self.current_expression.get_default_variant()

# Main getters and setters

def get_name(self) -> str:
"""Return model name"""
return self.name

def get_version(self) -> int:
"""Return model version"""
return self.version

def get_styles(self) -> dict[str, Style]:
"""Get the list of available styles
Expand Down
4 changes: 2 additions & 2 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
setup(
name = 'livepng',
packages = ['livepng'],
version = '0.1.5',
version = '0.1.6',
license='GGPLv3',
description = 'LivePNG is a format to create avatars based on PNG images with lipsync support',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author = 'Francesco Caracciolo',
author_email = '[email protected]',
url = 'https://github.com/francescocaracciolo/livepng',
download_url = 'https://github.com/FrancescoCaracciolo/LivePNG/archive/refs/tags/0.1.5.tar.gz',
download_url = 'https://github.com/FrancescoCaracciolo/LivePNG/archive/refs/tags/0.1.6.tar.gz',
keywords = ['avatar', 'png', 'lipsync', 'livepng', 'anime'],
install_requires=[
'pydub',
Expand Down

0 comments on commit 5330e90

Please sign in to comment.