File: run.py

package info (click to toggle)
pup 0.4.0%2Bgit20190919.681d7bb-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 384 kB
  • sloc: sh: 50; ruby: 15; python: 10; makefile: 4
file content (14 lines) | stat: -rwxr-xr-x 396 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python

from __future__ import print_function
from hashlib import sha1
from subprocess import Popen, PIPE, STDOUT

data = open("index.html", "r").read()

for line in open("cmds.txt", "r"):
    line = line.strip()
    p = Popen(['pup', line], stdout=PIPE, stdin=PIPE, stderr=PIPE)
    h = sha1()
    h.update(p.communicate(input=data)[0])
    print("%s %s" % (h.hexdigest(), line))