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 -x | |
| # Usage: python-bootstrap.sh <PYTHON PREFIX> <VIRTUALENV PREFIX> | |
| # Define these env variables to override the defaults | |
| PYTHON_VERSIONS=${PYTHON_VERSIONS:-"2.5.6 2.6.7 2.7.2"} | |
| VIRTUALENV_VERSION=${VIRTUALENV_VERSION:-1.7} | |
| PYTHON_MODULES=${PYTHON_MODULES:-"distribute requests"} | |
| CPU_COUNT=${CPU_COUNT:-4} | |
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 -x | |
| set -e | |
| str_md5() { | |
| MD5=$(md5sum <<< $*) | |
| echo ${MD5:0:32} | |
| } | |
| force_download() { |
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 -x | |
| set -e | |
| mktempdir() { | |
| case $OSTYPE in | |
| darwin*) | |
| PREFIX=$(basename $0) | |
| DIR=$(mktemp -d -t $PREFIX) | |
| ;; |
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 os | |
| import P4 | |
| class Perforce(object): | |
| def __init__(self, user=None, password=None, auto_login=True): | |
| if not user: | |
| if 'P4USER' in os.environ: |
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
| """\ | |
| See `StreamLogger`. | |
| """ | |
| import sys | |
| import logging | |
| import cStringIO | |
| class StreamLogger(object): |
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
| """\ | |
| Init: | |
| from fabric.api import env | |
| if isinstance(env.roledefs, dict): | |
| env.roledefs = RolesManager(env.roledefs) | |
| dummy_backend = {'foo': 'some.fqdn'} | |
| env.roledefs.register_backend('dummy', dummy_backend) |
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 os | |
| import unittest | |
| import ConfigParser | |
| import cStringIO | |
| import requests | |
| from bs4 import BeautifulSoup | |
| class TestHttp(unittest.TestCase): |
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 os | |
| import unittest | |
| import ftplib | |
| import cStringIO | |
| import hashlib | |
| def fileobj_md5(fileobj, blocksize=128): | |
| fileobj.seek(0) | |
| md5 = hashlib.md5() |
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 SOAPpy | |
| # Fix for the bogus Confluence XML answers | |
| def confluence_soap_parser(xml_str, rules=None, parser=SOAPpy.Parser._parseSOAP): | |
| attribute = 'xsi:type="soapenc:Array"' | |
| xml_str = xml_str.replace('%s %s' % (attribute, attribute), attribute) | |
| return parser(xml_str, rules=rules) | |
| SOAPpy.Parser._parseSOAP = confluence_soap_parser |
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 | |
| import os | |
| import flask | |
| app = flask.Flask(__name__, | |
| static_url_path='/pypi', | |
| static_folder=os.environ['PACKAGES_DIR']) |
OlderNewer