Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kitsune/questions/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def test_list_value_is_or(self):
q2 = question(metadata={'os': 'OSX'}, save=True)
question(metadata={'os': 'Windows 7'}, save=True)
res = self.filter({'os': ['Linux', 'OSX']})
eq_(list(res), [q1, q2])
eq_(sorted(res, key=lambda q: q.id), [q1, q2])

def test_none_value_is_missing(self):
q1 = question(metadata={}, save=True)
Expand All @@ -609,7 +609,7 @@ def test_list_value_with_none(self):
q2 = question(metadata={}, save=True)
question(metadata={'os': 'Windows 7'}, save=True)
res = self.filter({'os': ['Linux', None]})
eq_(list(res), [q1, q2])
eq_(sorted(res, key=lambda q: q.id), [q1, q2])

def test_is_taken(self):
u = user(save=True)
Expand Down
38 changes: 25 additions & 13 deletions requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ celery==3.1.17
# sha256: 95yMBNfrUAcbytZ_0j88EPq2xy1WhXrfhINngGhF1uU
click==3.3

# sha256: JTLZ46-ePG0PcQ_JiwKVtWPH85z9l90iQr02-_SQBhA
cffi==0.8.6

# commonware: master
# sha256: k9gjEUXUPKAuHsPO41UzOvqOcq25z4FXZ-F1lXSXdNQ
https://github.com/jsocol/commonware/archive/b5544185b2d24adc1eb512735990752400ce9cbd.tar.gz#egg=commonware

# sha256: -rf83eNg7GYURC0DIdzQ7_XkNUTLMNl16ddakUpM33g
cryptography==0.7.2

# sha256: MxnZwEi7pMyJqWkRgdDgIYei8JtDQ_0vz2zL-EtO4Yo
dennis==0.6.1

Expand Down Expand Up @@ -161,6 +167,9 @@ elasticutils==0.10.1
# sha256: u5PYXKflDWjkGXhSu226YJi7dyUA-C9dsv9KgHEVBck
elasticsearch==1.2.0

# sha256: 08GfJqajRinBjHdfWd_F3VlXZMcitXotpW6_tpuU5Ec
enum34==1.0.4

# sha256: A3VLx7JWOXwbZG5QSOIpFZD1CAFxrbiwD04tc4THbu4
GitPython==0.1.7

Expand Down Expand Up @@ -209,9 +218,8 @@ MySQL-python==1.2.3c1
# sha256: sboSwcRTI_2Glb5oznIoRWuG5RI08WcCfrvEzNqFLGE
nose==1.1.2

# oauthlib: tags/0.5.0~18
# sha256: tHdrttt9XnQAFXwSPTMZ_al_OxYhfBpgeLLXuSbH_L0
https://github.com/idan/oauthlib/archive/8a7b279e44efacccab7eee6bb60143120c45eca1.tar.gz#egg=oauthlib
# sha256: oFHwTujsMwUFWrNNh7NsmkSTdeB8fWoFvK-kgynKx8M
oauthlib==0.7.2

# sha256: HDW0rCBs7y0kgWyJ-Jzyid09OM98RJuz-re_bUPwGx8
ordereddict==1.1
Expand All @@ -233,8 +241,8 @@ https://github.com/pcraciunoiu/py-wikimarkup/archive/ce7d10dbd421533bb9b0c41dd9c
# sha256: KR27SJO1C3yD8sjfYlFo-hcqZ_h-tE85oHIivjuNnJU
pyes==0.16.0

# sha256: IeErA6uqDgTsyM2cJRWY9xuuEcnzhTBCNOTqVhjGFjs
pyOpenSSL==0.13
# sha256: qZ245ZwSATitinLuztzCS0UQ0u7TzkghO34y8izE7m4
pyOpenSSL==0.14

# sha256: 0XVN8IAYcdBalvHO9QpPMuXUDUnqJKocbKlSnL1WIAU
pyparsing==1.5.5
Expand All @@ -251,6 +259,12 @@ python-gflags==2.0
# sha256: ZrvGLZUZ-dUxsfd-aH2fL15SHLkG8f1yMfQDmX4BEMQ
python-memcached==1.48

# sha256: 5PgdU8Uz9r2VJrBH8Ef3sQHCSrFzOcGnrY-YslwQHqs
pyasn1==0.1.7

# sha256: lX2YtmHAtktYCrb5SxJeCbZxQVTuUd5AvKFtPwB2uGw
pycparser==2.10

# python-recaptcha: ssl-enabled
# sha256: eptgBDruYdbl_f_FcsZDFOptnKCa_w0vKpPOe6jTOxk
https://github.com/bltravis/python-recaptcha/archive/d7db50afc711ef623aec8e472ff55627e66fcd87.tar.gz#egg=python-recaptcha
Expand All @@ -266,13 +280,11 @@ https://github.com/getsentry/raven-python/archive/ab53d276262a0fa2932588b34de4e6
# sha256: pKrx7rUrWH9IbMYyT2MF62gW_bVPony2JPDx0TecNP0
https://github.com/andymccurdy/redis-py/archive/43aa23146ad287959369161038a4e5cda985a259.tar.gz#egg=redis

# requests: tags/v1.1.0
# sha256: LFetLgx3GU1fkbaxtU_ewDWhuM_CTQR3sIcrFsKldDM
https://github.com/kennethreitz/requests/archive/1a7c91f6581c80122ed8cd1fdf4a8ca38c842453.tar.gz#egg=requests==1.1.0
# sha256: e3c179Ox4jI9yfzvBgs4DQX18YvQ8kf16edKYoJ53mY
requests==2.5.1

# requests-oauthlib: tags/v0.3.3~12
# sha256: uOoyEafcwZIXaIFQOsl_ffe0JIVmLZzuahgcNqZg78Y
https://github.com/requests/requests-oauthlib/archive/3d9fe79cd92c6c2e36fba993c19b957804cf8d7f.tar.gz#egg=requests-oauthlib
# sha256: ngIjuJUY7axhqXtW_3jycQVs4IyKF8a2RK7yRPrIPyM
requests-oauthlib==0.4.2

# schematic: master
# sha256: ELrq_ifCkWujoqbRrfIsQakd640Hn1kJAu2P36B6Nf8
Expand All @@ -288,8 +300,8 @@ setuptools==0.9.8
# sha256: _lMoR-CPEVj4EJr9NJdUBZ4QFYMNsYjXOwHi7MD35Sg
simplejson==3.1.2

# sha256: 8EWv1t_7dVzAQRrLfOmsxN4OcSYdS1-R3i5o2apfg2c
six==1.4.1
# sha256: 4kBSQR_E-9H2cmNVN8P8IzDZSBsYwDF2lbRiWVEskdU
six==1.9.0

# sha256: pvB08EimOg0ZzRpq4pg3e0gANR7KjhKU0z9wnFzdXlo
South==0.8.2
Expand Down
7 changes: 6 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# These requirements are helpful, but not required, for working on Kitsune.

# sha256: yfS7goDAxl8gqd_IQRV_y0eUYeyuaXKoozNj52k6qRc
chief-james==1.0.0

# sha256: 6U6syZbt8Rq7o3Lw3APp2PHQCIn9KeiTXE6bvZuir9w
django-debug-toolbar==1.2.2

Expand All @@ -12,6 +15,9 @@ flake8==2.2.5
# sha256: WioXDkfeVZOmq_rh6VQr0sOSSsYrvk5u2WyVPANSJDo
mccabe==0.2.1

# sha256: e5YBIl0vUwZjVn0DMm8o8ipKZCPlasGBLWH9IEEmM_I
ndg-httpsclient==0.3.3

# sha256: ku47hrXBkhwtnawhe--JkMX4Usi8TZAYyv4PPzuBzTo
nosenicedots==0.5

Expand All @@ -29,4 +35,3 @@ Sphinx==1.2.3

# sha256: x9txeBCraWX2bIzwOYqYydjfmC2jm0zX8WKRHriVlvo
docutils==0.12

50 changes: 41 additions & 9 deletions scripts/peep.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,20 @@ def activate(specifier):
except ImportError:
from pip import logger # 6.0
from pip.req import parse_requirements
try:
from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner
except ImportError:
class NullProgressBar(object):
def __init__(self, *args, **kwargs):
pass

def iter(self, ret, *args, **kwargs):
return ret

__version__ = 2, 1, 1
DownloadProgressBar = DownloadProgressSpinner = NullProgressBar


__version__ = 2, 2, 0


ITS_FINE_ITS_FINE = 0
Expand Down Expand Up @@ -487,14 +498,31 @@ def best_filename(link, response):
return filename

# Descended from _download_url() in pip 1.4.1
def pipe_to_file(response, path):
"""Pull the data off an HTTP response, and shove it in a new file."""
# TODO: Indicate progress.
with open(path, 'wb') as file:
def pipe_to_file(response, path, size=0):
"""Pull the data off an HTTP response, shove it in a new file, and
show progress.

:arg response: A file-like object to read from
:arg path: The path of the new file
:arg size: The expected size, in bytes, of the download. 0 for
unknown or to suppress progress indication (as for cached
downloads)

"""
def response_chunks(chunk_size):
while True:
chunk = response.read(4096)
chunk = response.read(chunk_size)
if not chunk:
break
yield chunk

print('Downloading %s%s...' % (
self._req.req,
(' (%sK)' % (size / 1000)) if size > 1000 else ''))
progress_indicator = (DownloadProgressBar(max=size).iter if size
else DownloadProgressSpinner().iter)
with open(path, 'wb') as file:
for chunk in progress_indicator(response_chunks(4096), 4096):
file.write(chunk)

url = link.url.split('#', 1)[0]
Expand All @@ -503,7 +531,11 @@ def pipe_to_file(response, path):
except (HTTPError, IOError) as exc:
raise DownloadError(link, exc)
filename = best_filename(link, response)
pipe_to_file(response, join(self._temp_path, filename))
try:
size = int(response.headers['content-length'])
except (ValueError, KeyError, TypeError):
size = 0
pipe_to_file(response, join(self._temp_path, filename), size=size)
return filename


Expand Down Expand Up @@ -722,6 +754,7 @@ def first_every_last(iterable, first, every, last):
did_first = False
for item in iterable:
if not did_first:
did_first = True
first(item)
every(item)
if did_first:
Expand Down Expand Up @@ -760,8 +793,7 @@ def peep_install(argv):

"""
output = []
#out = output.append
out = print
out = output.append
reqs = []
try:
req_paths = list(requirement_args(argv, want_paths=True))
Expand Down