./bootstrap.sh ./app.py worker --events --purge --loglevel=DEBUG --concurrency 5
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 logging | |
| import subprocess | |
| import time | |
| import sys | |
| import win32con | |
| import win32gui_struct | |
| import os | |
| try: | |
| import winxpgui as win32gui | |
| except ImportError: |
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
| def join(resultset, task_options=(), queue_results=False, propagate=True, | |
| interval=0.5, cleanup=None): | |
| pending_results = deque(resultset.results) | |
| resultset = ResultSet(list(resultset.results)) | |
| completed_results = [] | |
| def handle_abort(): | |
| logger.warning( | |
| "task_control.join is aborting ! Revoking taskset %s and calling cleanup function %r.", | |
| resultset, | |
| cleanup |
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
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| min-height: 100%; |
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 sys | |
| try: | |
| from sqlparse import format as sqlformat | |
| except ImportError: | |
| sqlformat = lambda s, reindent=None: s | |
| from traceback import format_stack | |
| class WithStacktrace(object): | |
| def __init__(self, skip=[], limit=5): | |
| self.skip = [__name__, 'logging'] |
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
| def monkeypatch(mod, what): | |
| """ | |
| Patch function named <what> from module <mod> to run the decorated function after <what> completes. | |
| Eg:: | |
| @monkeypatch(os, 'forkpty') | |
| def patched_forkpty(pid_fd): | |
| pid, fd = pid_fd | |
| if not pid: |
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
| val = cache.get(key) | |
| if val: | |
| return val | |
| else: | |
| with cache.lock(key): | |
| val = cache.get(key) | |
| if val: | |
| return val | |
| else: |
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/env python | |
| """ | |
| jngo -- The unhealthily compressed Django application. | |
| Usage: ./jngo.py | |
| Assuming a working install of Django (http://djangoproject.com/) and SQLite | |
| (http://sqlite.org), this script can be executed directly without any other | |
| preparations -- you don't have to do `setup.py install`, it doesn't | |
| need to be on your Python path, you don't need to set DJANGO_SETTINGS_MODULE, |
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
| #!/bin/bash -eEx | |
| if ! which gpg-agent; then | |
| sudo apt-get install gnupg-agent | |
| fi | |
| if ! which pull-lp-source; then | |
| sudo apt-get install ubuntu-dev-tools | |
| fi | |
| gpg-agent || eval `gpg-agent --daemon` |
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/env python | |
| # -*- coding: utf-8 -*- | |
| # Droopy (http://stackp.online.fr/droopy) | |
| # Copyright 2008-2012 (c) Pierre Duquesne <stackp@online.fr> | |
| # Licensed under the New BSD License. | |
| # Changelog | |
| # 20120108 * Taiwanese translation by Li-cheng Hsu. | |
| # 20110928 * Correctly save message with --save-config. Fix by Sven Radde. |