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
#!/usr/bin/env python | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Richard Hawkins | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so | |
# Distribution / packaging | |
.Python |
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
#!/usr/bin/env python | |
"""Make the X cursor wrap-around. | |
Adapted from http://appdb.winehq.org/objectManager.php?sClass=version&iId=12599 | |
to work around lack of relative mouse movement http://wiki.winehq.org/Bug6971 | |
for Thief: Dark Shadows (and possibly others) | |
This version is a little kinder to your CPU than the shell script with | |
the busy-loop that starts a new process for every pointer query. | |
""" |
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
#!/usr/bin/env python | |
import argparse | |
import cairo | |
from gi.repository import Gtk | |
from gi.repository import Gdk | |
from gi.repository import GdkPixbuf | |
from gi.repository import GObject |
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
from itertools import izip, product, tee | |
# Logic functions: take and return iterators of truth values | |
def AND(a, b): | |
for p, q in izip(a, b): | |
yield p and q | |
def OR(a, b): | |
for p, q in izip(a, b): |