class Config(object): DATA_FOLDER = "dataset" NAME = "config.json" def __init__(self, path): # check if json file given or folder if path[-5:] != ".json": path = os.path.join(path, self.NAME) with open(path) as file: self.config = json.load(file) self.label_configs = self.config['Actions'] self.labels = ["No gesture"] for index, label_config in enumerate(self.config['Actions']): self.labels.append(label_config['Name']) self.labels.append("blank") self.num_labels = len(self.labels) self.hardware = Hardware(self.config['hardware']) self.streams = self.hardware.from_module("STREAMS") self.size = {} for stream in self.streams: width = self.hardware.from_module(stream + "_WIDTH") height = self.hardware.from_module(stream + "_HEIGHT") self.size[stream] = (width, height) self.data_dir = os.path.join("datasets", self.hardware.name) def dump(self, location): """Dump the current config.""" name = os.path.join(location, self.NAME) with open(name, 'w') as out: json.dump(self.config, out)
def post_install(self, dest_dir): """ Post install commands """ # Add repos to user's pacman.conf path = os.path.join(dest_dir, "etc/pacman.conf") self.add_repositories(path) Hardware.chroot(["systemctl", "enable", "atieventsd"]) Hardware.chroot(["systemctl", "enable", "catalyst-hook"]) Hardware.chroot(["systemctl", "enable", "temp-links-catalyst"]) Hardware.chroot(["aticonfig", "--initial"], dest_dir)
def __init__(self, path): # check if json file given or folder if path[-5:] != ".json": path = os.path.join(path, self.NAME) with open(path) as file: self.config = json.load(file) self.label_configs = self.config['Actions'] self.labels = ["No gesture"] for index, label_config in enumerate(self.config['Actions']): self.labels.append(label_config['Name']) self.labels.append("blank") self.num_labels = len(self.labels) self.hardware = Hardware(self.config['hardware']) self.streams = self.hardware.from_module("STREAMS") self.size = {} for stream in self.streams: width = self.hardware.from_module(stream + "_WIDTH") height = self.hardware.from_module(stream + "_HEIGHT") self.size[stream] = (width, height) self.data_dir = os.path.join("datasets", self.hardware.name)
def post_install(dest_dir): """ Post install commands """ path = os.path.join(dest_dir, "etc/modules-load.d") os.makedirs(path, mode=0o755, exist_ok=True) path = os.path.join(dest_dir, "etc/modules-load.d/virtualbox-guest.conf") with open(path, 'w') as modules: modules.write('# Virtualbox modules added by Cnchi - Antergos Installer\n') modules.write("vboxguest\n") modules.write("vboxsf\n") modules.write("vboxvideo\n") Hardware.chroot(["systemctl", "disable", "openntpd"], dest_dir) Hardware.chroot(["systemctl", "-f", "enable", "vboxservice"], dest_dir) # This fixes bug in virtualbox-guest-modules package Hardware.chroot(["depmod", "-a"], dest_dir)
def post_install(dest_dir): """ Post install commands """ path = os.path.join(dest_dir, "etc/modules-load.d") os.makedirs(path, mode=0o755, exist_ok=True) path = os.path.join(dest_dir, "etc/modules-load.d/virtualbox-guest.conf") with open(path, 'w') as modules: modules.write( '# Virtualbox modules added by Cnchi - Antergos Installer\n') modules.write("vboxguest\n") modules.write("vboxsf\n") modules.write("vboxvideo\n") Hardware.chroot(["systemctl", "disable", "openntpd"], dest_dir) Hardware.chroot(["systemctl", "-f", "enable", "vboxservice"], dest_dir) # This fixes bug in virtualbox-guest-modules package Hardware.chroot(["depmod", "-a"], dest_dir)
def __init__(self): Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES)
def __init__(self): Hardware.__init__(self)
def post_install(dest_dir): """ Post install commands """ Hardware.chroot(["systemctl", "enable", "vmtoolsd"], dest_dir)
def __init__(self): Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES, PRIORITY, ENABLED)