Example #1
0
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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
    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)
Example #6
0
    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)
Example #7
0
 def __init__(self):
     Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES)
Example #8
0
 def __init__(self):
     Hardware.__init__(self)
Example #9
0
 def __init__(self):
     Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES)
Example #10
0
 def post_install(dest_dir):
     """ Post install commands """
     Hardware.chroot(["systemctl", "enable", "vmtoolsd"], dest_dir)
Example #11
0
 def __init__(self):
     Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES,
                       PRIORITY, ENABLED)
Example #12
0
 def __init__(self):
     Hardware.__init__(self, CLASS_NAME, CLASS_ID, VENDOR_ID, DEVICES, PRIORITY, ENABLED)