Permalink
Browse files

remove vendor and vendor-local

  • Loading branch information...
1 parent 890963f commit 451f0ab1cd868e1285bbf32928a1cd14f21e8fd5 @wraithan wraithan committed Oct 2, 2012
@@ -1,3 +1,3 @@
--r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
-
+Jinja2==2.6
M2Crypto>=0.20.0
+MySQL-python==1.2.4b2
View
@@ -2,5 +2,7 @@
# needed to run the site, it belongs in requirements/prod.txt. If it's a
# package for developers (testing, docs, etc.), it goes in this file.
--r ../vendor/src/funfactory/funfactory/requirements/compiled.txt
--r ../vendor/src/funfactory/funfactory/requirements/dev.txt
+-r prod.txt
+-r compiled.txt
+
+ipython==0.13
View
@@ -1 +1,26 @@
--r ../vendor/src/funfactory/funfactory/requirements/prod.txt
+Django==1.4.1
+PyJWT==0.1.4
+cef==0.3
+commonware==0.4.0
+django-multidb-router
+django-mysql-aesfield==0.2.1
+django-nose==1.1
+django-statsd-mozilla==0.3.7
+django-tastypie==0.9.11
+funfactory==2.1.1
+jingo==0.4
+mimeparse==0.1.3
+nose==1.2.1
+python-dateutil==2.1
+python-memcached==1.48
+raven==2.0.6
+requests==0.14.1
+simplejson==2.6.2
+six==1.2.0
+statsd==1.0.0
+tower==0.3.4
+
+# not on pypi
+-e git+https://github.com/fwenzel/django-sha2.git@f4519bf0cc9b1dd7a7d78394fa4aec4504bc86e9#egg=django-sha2
+-e git+https://github.com/mozilla/nuggets.git@96e80a64aa4bfcfef4f43fc3ab6966450ccd7325#egg=nuggets
+-e git+https://github.com/jbalogh/test-utils.git@3c2214d193d1b0c0d74c77b3731c8afb0173e669#egg=test-utils
View
@@ -0,0 +1,4 @@
+-r prod.txt
+-r compiled.txt
+
+mock==1.0b1
View
@@ -0,0 +1 @@
+this-is-a-sample-for-testing
View
@@ -1,7 +1,8 @@
# test_utils picks this file up for testing.
import os
+
filename = os.path.join(os.path.dirname(__file__),
- 'vendor-local/django-mysql-aesfield/aesfield/sample.key')
+ 'sample.key')
AES_KEYS = {
'buyerpaypal:key': filename,
'sellerpaypal:id': filename,
@@ -12,7 +12,6 @@
INSTALLED_APPS = (
'aesfield',
'funfactory',
- 'django_nose',
'django_statsd',
'solitude',
)
1 vendor
Submodule vendor deleted from f7805f
Submodule django-statsd deleted from d4a963
Submodule django-tastypie deleted from 8a94dc
@@ -1 +0,0 @@
-from mimeparse import *
@@ -1,134 +0,0 @@
-"""MIME-Type Parser
-
-This module provides basic functions for handling mime-types. It can handle
-matching mime-types against a list of media-ranges. See section 14.1 of
-the HTTP specification [RFC 2616] for a complete explanation.
-
- http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
-
-Contents:
- - parse_mime_type(): Parses a mime-type into its component parts.
- - parse_media_range(): Media-ranges are mime-types with wild-cards and a 'q' quality parameter.
- - quality(): Determines the quality ('q') of a mime-type when compared against a list of media-ranges.
- - quality_parsed(): Just like quality() except the second parameter must be pre-parsed.
- - best_match(): Choose the mime-type with the highest quality ('q') from a list of candidates.
-"""
-
-__version__ = "0.1.3"
-__author__ = 'Joe Gregorio'
-__email__ = "joe@bitworking.org"
-__credits__ = ""
-
-def parse_mime_type(mime_type):
- """Carves up a mime-type and returns a tuple of the
- (type, subtype, params) where 'params' is a dictionary
- of all the parameters for the media range.
- For example, the media range 'application/xhtml;q=0.5' would
- get parsed into:
-
- ('application', 'xhtml', {'q', '0.5'})
- """
- parts = mime_type.split(";")
- params = dict([tuple([s.strip() for s in param.split("=")])\
- for param in parts[1:] ])
- full_type = parts[0].strip()
- # Java URLConnection class sends an Accept header that includes a single "*"
- # Turn it into a legal wildcard.
- if full_type == '*': full_type = '*/*'
- (type, subtype) = full_type.split("/")
- return (type.strip(), subtype.strip(), params)
-
-def parse_media_range(range):
- """Carves up a media range and returns a tuple of the
- (type, subtype, params) where 'params' is a dictionary
- of all the parameters for the media range.
- For example, the media range 'application/*;q=0.5' would
- get parsed into:
-
- ('application', '*', {'q', '0.5'})
-
- In addition this function also guarantees that there
- is a value for 'q' in the params dictionary, filling it
- in with a proper default if necessary.
- """
- (type, subtype, params) = parse_mime_type(range)
- if not params.has_key('q') or not params['q'] or \
- not float(params['q']) or float(params['q']) > 1\
- or float(params['q']) < 0:
- params['q'] = '1'
- return (type, subtype, params)
-
-def fitness_and_quality_parsed(mime_type, parsed_ranges):
- """Find the best match for a given mime-type against
- a list of media_ranges that have already been
- parsed by parse_media_range(). Returns a tuple of
- the fitness value and the value of the 'q' quality
- parameter of the best match, or (-1, 0) if no match
- was found. Just as for quality_parsed(), 'parsed_ranges'
- must be a list of parsed media ranges. """
- best_fitness = -1
- best_fit_q = 0
- (target_type, target_subtype, target_params) =\
- parse_media_range(mime_type)
- for (type, subtype, params) in parsed_ranges:
- if (type == target_type or type == '*' or target_type == '*') and \
- (subtype == target_subtype or subtype == '*' or target_subtype == '*'):
- param_matches = reduce(lambda x, y: x+y, [1 for (key, value) in \
- target_params.iteritems() if key != 'q' and \
- params.has_key(key) and value == params[key]], 0)
- fitness = (type == target_type) and 100 or 0
- fitness += (subtype == target_subtype) and 10 or 0
- fitness += param_matches
- if fitness > best_fitness:
- best_fitness = fitness
- best_fit_q = params['q']
-
- return best_fitness, float(best_fit_q)
-
-def quality_parsed(mime_type, parsed_ranges):
- """Find the best match for a given mime-type against
- a list of media_ranges that have already been
- parsed by parse_media_range(). Returns the
- 'q' quality parameter of the best match, 0 if no
- match was found. This function bahaves the same as quality()
- except that 'parsed_ranges' must be a list of
- parsed media ranges. """
- return fitness_and_quality_parsed(mime_type, parsed_ranges)[1]
-
-def quality(mime_type, ranges):
- """Returns the quality 'q' of a mime-type when compared
- against the media-ranges in ranges. For example:
-
- >>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')
- 0.7
-
- """
- parsed_ranges = [parse_media_range(r) for r in ranges.split(",")]
- return quality_parsed(mime_type, parsed_ranges)
-
-def best_match(supported, header):
- """Takes a list of supported mime-types and finds the best
- match for all the media-ranges listed in header. The value of
- header must be a string that conforms to the format of the
- HTTP Accept: header. The value of 'supported' is a list of
- mime-types. The list of supported mime-types should be sorted
- in order of increasing desirability, in case of a situation
- where there is a tie
-
- >>> best_match(['application/xbel+xml', 'text/xml'], 'text/*;q=0.5,*/*; q=0.1')
- 'text/xml'
- """
- parsed_header = [parse_media_range(r) for r in _filter_blank(header.split(","))]
- weighted_matches = []
- pos = 0
- for mime_type in supported:
- weighted_matches.append((fitness_and_quality_parsed(mime_type,
- parsed_header), pos, mime_type))
- pos += 1
- weighted_matches.sort()
- return weighted_matches[-1][0][1] and weighted_matches[-1][2] or ''
-
-def _filter_blank(i):
- for s in i:
- if s.strip():
- yield s
Submodule pyjwt deleted from 420cb4
Submodule raven deleted from 0d1266
Submodule simplejson deleted from 16b63c
@@ -1,35 +0,0 @@
-import os
-import socket
-
-try:
- from django.conf import settings
-except ImportError:
- settings = None
-
-from client import StatsClient
-
-
-__all__ = ['StatsClient', 'statsd']
-
-VERSION = (0, 5, 1)
-__version__ = '.'.join(map(str, VERSION))
-
-
-statsd = None
-
-if settings:
- try:
- host = getattr(settings, 'STATSD_HOST', 'localhost')
- port = getattr(settings, 'STATSD_PORT', 8125)
- prefix = getattr(settings, 'STATSD_PREFIX', None)
- statsd = StatsClient(host, port, prefix)
- except (socket.error, socket.gaierror, ImportError):
- pass
-elif 'STATSD_HOST' in os.environ:
- try:
- host = os.environ['STATSD_HOST']
- port = int(os.environ['STATSD_PORT'])
- prefix = os.environ.get('STATSD_PREFIX')
- statsd = StatsClient(host, port, prefix)
- except (socket.error, socket.gaierror, KeyError):
- pass
@@ -1,76 +0,0 @@
-from functools import wraps
-import random
-import socket
-import time
-
-
-class _Timer(object):
- """A context manager/decorator for statsd.timing()."""
-
- def __init__(self, client, stat, rate=1):
- self.client = client
- self.stat = stat
- self.rate = rate
- self.ms = None
-
- def __call__(self, f):
- @wraps(f)
- def wrapper(*args, **kw):
- with self:
- return f(*args, **kw)
- return wrapper
-
- def __enter__(self):
- self.start = time.time()
- return self
-
- def __exit__(self, typ, value, tb):
- dt = time.time() - self.start
- self.ms = int(round(1000 * dt)) # Convert to ms.
- self.client.timing(self.stat, self.ms, self.rate)
-
-
-class StatsClient(object):
- """A client for statsd."""
-
- def __init__(self, host='localhost', port=8125, prefix=None):
- """Create a new client."""
- self._addr = (socket.gethostbyname(host), port)
- self._sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- self._prefix = prefix
-
- def timer(self, stat, rate=1):
- return _Timer(self, stat, rate)
-
- def timing(self, stat, delta, rate=1):
- """Send new timing information. `delta` is in milliseconds."""
- self._send(stat, '%d|ms' % delta, rate)
-
- def incr(self, stat, count=1, rate=1):
- """Increment a stat by `count`."""
- self._send(stat, '%s|c' % count, rate)
-
- def decr(self, stat, count=1, rate=1):
- """Decrement a stat by `count`."""
- self.incr(stat, -count, rate)
-
- def gauge(self, stat, value, rate=1):
- """Set a gauge value."""
- self._send(stat, '%s|g' % value, rate)
-
- def _send(self, stat, value, rate=1):
- """Send data to statsd."""
- if rate < 1:
- if random.random() < rate:
- value = '%s|@%s' % (value, rate)
- else:
- return
-
- if self._prefix:
- stat = '%s.%s' % (self._prefix, stat)
-
- try:
- self._sock.sendto('%s:%s' % (stat, value), self._addr)
- except socket.error:
- # No time for love, Dr. Jones!
- pass
Oops, something went wrong.

0 comments on commit 451f0ab

Please sign in to comment.