예제 #1
0
    def crawl_directory(self, directory: Path, tree_root: List) -> None:
        for p in directory.iterdir():
            self.counter += 1

            if p.is_file():
                if re.search(r"pupil_\w*\.exe", p.name):
                    # skip executable
                    continue
                component = {
                    "type": "component",
                    "id": f"FileComponent{self.counter}{self.name}",
                    "guid": new_guid(),
                    "file_id": f"File{self.counter}{self.name}",
                    "file_name": p.name,
                }
                tree_root.append(component)
                self.component_ids.append(component["id"])

            else:
                directory = {
                    "type": "directory",
                    "id": f"Dir{self.counter}{self.name}",
                    "name": p.name,
                    "content": [],
                }
                tree_root.append(directory)
                self.crawl_directory(p, tree_root=directory["content"])
예제 #2
0
    def bind(self, event, callback):
        guid = new_guid()
        if event not in self.__callbacks:
            self.__callbacks[event] = {}

        self.__callbacks[event][guid] = callback

        return guid
예제 #3
0
                f"Found release dir for version '{version}': {base_dir.name}")
            break
else:
    raise RuntimeError("Could not find any release dir!")

product_name = f"Pupil {version}"
company_short = "Pupil-Labs"
manufacturer = "Pupil-Labs GmbH"

package_description = f"{company_short} {product_name}"

# NOTE: Generating new GUIDs for product and upgrade code means that different
# installations will not conflict. This is the easiest workflow for enabling customers
# to install different versions alongside. This will however also mean that in the case
# of a patch, the users will always also have to uninstall the old version manually.
product_guid = new_guid()
product_upgrade_code = new_guid()


class SoftwareComponent:
    """Represents capture, player or service and collects all info for WiX XML."""
    def __init__(self, base_dir: Path, name: str, version: str):
        self.name = name
        self.base_dir = base_dir
        for p in self.base_dir.iterdir():
            if p.is_dir() and p.name.startswith(
                    f"pupil_{self.name}_windows_x64"):
                self.dir = p
                break

        self.display_name = f"Pupil {self.name.capitalize()} {version}"