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
import re | |
from hashlib import md5 | |
def gfm(text): | |
# Extract pre blocks. | |
extractions = {} | |
def pre_extraction_callback(matchobj): | |
digest = md5(matchobj.group(0)).hexdigest() | |
extractions[digest] = matchobj.group(0) | |
return "{gfm-extraction-%s}" % digest |
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
""" | |
Thread pool extensions to SocketServer. | |
""" | |
import Queue | |
import SocketServer | |
import sys | |
import threading |
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
# The example of a multi-select dialog in a Kodi addon created with PyXBMCt framework. | |
# You will need a checkmark image file. | |
import os | |
import xbmcgui | |
import xbmcaddon | |
import pyxbmct.addonwindow as pyxbmct | |
_addon = xbmcaddon.Addon() | |
_path = _addon.getAddonInfo("path") | |
_check_icon = os.path.join(_path, "check.png") # Don't decode _path to utf-8!!! |
NewerOlder