-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add encode, makegen, and plate utilities
- Loading branch information
0 parents
commit 79e0a88
Showing
13 changed files
with
1,603 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# generic | ||
.\#* | ||
.nfs???? | ||
dist/ | ||
*~ | ||
*.log | ||
*.tmp | ||
|
||
# native | ||
a.out | ||
*.a | ||
*.dll | ||
*.dylib | ||
*.exe | ||
*.gch | ||
*.ipch | ||
*.lib | ||
*.o | ||
*.obj | ||
*.so | ||
*.sdf | ||
*.stackdump | ||
|
||
# Fortran | ||
*.mod | ||
|
||
# Haskell | ||
.cabal-sandbox/ | ||
cabal.sandbox.config | ||
*.chi | ||
*.hcr | ||
*.hi | ||
|
||
# JavaScript | ||
node_modules/ | ||
|
||
# Python | ||
MANIFEST | ||
__pycache__ | ||
*.pyc | ||
|
||
# Rust | ||
target/ | ||
Cargo.lock | ||
|
||
# TeX | ||
*.aux | ||
*.bbl | ||
*.blg | ||
*.thm | ||
*.toc | ||
*Notes.bib | ||
|
||
# web | ||
.sass-cache | ||
*.css.map | ||
*.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
devutils | ||
======== | ||
|
||
Miscellaneous development utilities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python | ||
# Wrapper around 'encode' to process checksums from tools like md5sum. Only | ||
# lines that look like checksums are processed. The rest are passed through | ||
# untouched. | ||
|
||
if __name__ != "__main__": | ||
raise ImportError("not an importable module") | ||
|
||
import re, subprocess, sys | ||
|
||
def call_encode(digest): | ||
p = subprocess.Popen( | ||
("encode", "-f", "hex", "-l", "-s") + tuple(sys.argv[1:]), | ||
stdin=subprocess.PIPE, | ||
stdout=subprocess.PIPE, | ||
) | ||
out = p.communicate(digest.encode("utf8"))[0].decode("utf8").strip() | ||
if p.returncode != 0: | ||
exit(1) | ||
return out | ||
|
||
try: | ||
# call once to make sure the arguments are sensible | ||
call_encode("") | ||
|
||
for line in sys.stdin: | ||
m = re.match(r"([-+_./A-Za-z0-9]+)( .*)", line) | ||
if m: | ||
digest, rest = m.groups() | ||
sys.stdout.write(call_encode(digest) + rest + "\n") | ||
else: | ||
sys.stdout.write(s) | ||
except IOError as e: | ||
import os | ||
sys.stderr.write("\n{0}: {1}\n".format(os.path.basename(sys.argv[0]), e)) | ||
exit(1) | ||
except KeyboardInterrupt: | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
exec encode --decode "$@" |
Oops, something went wrong.