from subprocess import CalledProcessError, check_output, run
GITWEB_CONFIGS = {
- "admin": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "admin scripts",
- },
- "mar77i.info": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "mar77i.info website",
- },
- "hublib": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "base for websocket toys",
- },
- "laptop-config": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "laptop screen configuration",
- },
- "rcfiles": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "user configuration files",
- },
- "bigintmandel": {
- "owner": "mar77i <mar77i@protonmail.ch>",
- "description": "Qt mandelbrot toy, with big integers only",
- },
+ "admin": "admin scripts",
+ "mar77i.info": "mar77i.info website",
+ "hublib": "base for websocket toys",
+ "laptop-config": "laptop screen configuration",
+ "rcfiles": "user configuration files",
+ "bigintmandel": "Qt mandelbrot toy, with big integers only",
+ "ga-cli": "Google authenticator for CLI",
}
if p.is_dir() and p.name not in GITWEB_CONFIGS:
rmtree(p)
print(f"removed {p.name}")
- for repository, configs in GITWEB_CONFIGS.items():
+ for repository, description in GITWEB_CONFIGS.items():
p = base_dir / repository
if not p.exists():
p.mkdir(0o755)
print(f"created {p.name}")
else:
os.chdir(p)
- description = p / "description"
- if description.exists():
- description.unlink()
- assert set(configs) == {"owner", "description"}
+ description_path = p / "description"
+ if description_path.exists():
+ description_path.unlink()
+ configs = {
+ "owner": "mar77i <mar77i@protonmail.ch>",
+ "description": description,
+ }
for key, value in configs.items():
try:
output = check_output(
- ["git", "config", "--get", f"gitweb.{key}"], universal_newlines=True
+ ["git", "config", "--get", f"gitweb.{key}"],
+ universal_newlines=True,
)
except CalledProcessError:
output = None