File: dulwich-serve.py

package info (click to toggle)
hg-git 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,432 kB
  • sloc: python: 8,200; sh: 185; makefile: 23
file content (22 lines) | stat: -rwxr-xr-x 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3
#
# Wrapper for dulwich.web that forks a web server in a subprocess and
# saves the PID.
#

import os
import subprocess
import sys


proc = subprocess.Popen(
    [
        sys.executable,
        "-m",
        "dulwich.web",
    ] + sys.argv[1:],
    stderr=subprocess.STDOUT,
)

with open(os.getenv("DAEMON_PIDS"), "a") as fp:
    fp.write("%d\n" % proc.pid)