1
0
mirror of https://github.com/ericchiang/pup synced 2024-11-28 02:48:16 +00:00
pup/tests/run.py
ericchiang d0ff822037 pup redone
Added:
* psuedo classes
   :empty
   :[first/last/only]-child
   :[first/last/only]-of-type
   :contains("text")
   :nth[-last]-child(n|odd|even|3n+1|n+2)
   :nth[-last]-of-type(n|odd|even|3n+2|n+2)
* json{} attr keys moved up a level
* quote enclosed attr selectors
* '+' and '>' intermediate selectors
2014-11-09 22:01:20 -05:00

15 lines
396 B
Python
Executable File

#!/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))