This file contains hidden or 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
#!/usr/bin/python3 | |
import functools | |
import pathlib | |
import time | |
import jwt | |
import requests | |
This file contains hidden or 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
import re | |
class Patch: | |
""" Parses and encapsulates a git unified diff/patch file. """ | |
# See: https://stackoverflow.com/questions/987372/what-is-the-format-of-a-patch-file | |
# Chunk headers look like: @@ -4,9 +4,12 @@. The following regex parses them | |
ptn = ( | |
r"@@ -(?P<old_start>\d+)," # Where the chunk begins in the old file |
This file contains hidden or 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
import ctypes | |
orelib = ctypes.cdll.LoadLibrary("./ore.so") | |
class PrintableCtypesStructure(ctypes.Structure): | |
def __str__(self): | |
return "{}: {{{}}}".format( | |
self.__class__.__name__, | |
", ".join( |