Object-oriented programming

All launcher functions are now return an object instead of a dict
This commit is contained in:
2022-01-29 23:25:03 +07:00
parent 8f32241191
commit a7ddd0c49a
13 changed files with 149 additions and 0 deletions

View File

@ -0,0 +1,9 @@
class IconOtherLink:
def __init__(self, title, url):
self.title = title
self.url = url
@staticmethod
def from_dict(data) -> 'IconOtherLink':
"""Creates a launcher icon other link from a dictionary."""
return IconOtherLink(data["title"], data["url"])