Zdalne-systemy-z-kit-uVPN/images.py
2023-04-21 16:39:25 +02:00

24 lines
542 B
Python

class Image:
def __init__(self, id, token, name, vpn_ip):
self.id = id
self.name = name
self.token = token
self.vpn_ip = vpn_ip
class ImageManager:
def __init__(self):
self.images = []
def add_image(self, machine):
self.images.append(machine)
def remove_image(self, machine):
self.images.remove(machine)
def get_image_by_token(self, token):
for image in self.images:
if image.token == token:
return image
return None