File: generate-cut-list.py

package info (click to toggle)
voctomix 1.3-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 3,368 kB
  • sloc: python: 4,958; sh: 733; makefile: 23
file content (21 lines) | stat: -rwxr-xr-x 432 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
import socket
import datetime
import sys

host = 'localhost'
port = 9999

conn = socket.create_connection((host, port))
fd = conn.makefile('rw')

for line in fd:
    words = line.rstrip('\n').split(' ')

    signal = words[0]
    args = words[1:]

    if signal == 'message' and args[0] == 'cut':
        ts = datetime.datetime.now().strftime("%Y-%m-%d/%H_%M_%S")
        print(ts)
        sys.stdout.flush()