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 python3 | |
import sys | |
import subprocess | |
with open(sys.argv[1], 'r+') as commit_message_file: | |
commit_message = list(commit_message_file) | |
for line in commit_message: | |
line = line.strip() |
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
# "Understanding Python's closures". | |
# | |
# Tested in Python 3.1.2 | |
# | |
# General points: | |
# | |
# 1. Closured lexical environments are stored | |
# in the property __closure__ of a function | |
# | |
# 2. If a function does not use free variables |
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 python3 | |
import subprocess | |
print('Fetching remote branches...') | |
subprocess.call('git fetch -p --all', shell=True) | |
print('Processing remote branches...') | |
remote_branches = subprocess.check_output( |
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 threading | |
def handleSigint(*args): | |
print 'Received SIGINT. Notifying worker threads to stop.', args | |
global shutdown | |
shutdown = True | |
shutdown = False |
NewerOlder