widget_width = size[0] // (3 if len(widget_row) == 3 else 2)
x = 0 if len(widget_row) > 0 else size[0] // 4
for keyset in widget_row:
- rect = pygame.Rect((x, half_height), (widget_width, half_height))
+ rect = pygame.Rect((x, widget_top), (widget_width, half_height))
if keyset is MousePadWidget:
keyset(self, rect, self.click_cb, self.move_cb)
elif keyset is ClockWidget:
raise SystemError("'venv' is not a directory.")
run_cmd((sys.executable, "-m", "venv", str(venv_dir)))
os.environ.update(get_venv_environ(venv_dir))
- has_pkgs = (
- venv_dir_is_dir
- and all(check_has_pkg(pkg) for pkg in pkgs)
- )
+ has_pkgs = (venv_dir_is_dir and all(check_has_pkg(pkg) for pkg in pkgs))
if get_ipv4_is_connected():
yesterday = time() - 86400
if not has_pkgs or all(
p.stat().st_mtime < yesterday for p in walk_outer(venv_dir)
):
- run_cmd(
- (
- executable,
- "-m",
- "pip",
- "install",
- "-qU",
- "pip",
- *pkgs
- )
- )
+ run_cmd((executable, "-m", "pip", "install", "-qU", "pip", *pkgs))
venv_dir.touch(0o755, True)
elif not has_pkgs:
raise ConnectionError("Internet needed to install requirement: pygame")