Commit abe61a16 authored by Denis Bilenko's avatar Denis Bilenko

pep8 fixes

parent da8ac8c6
...@@ -7,6 +7,6 @@ urlpatterns = patterns('webchat.chat.views', ...@@ -7,6 +7,6 @@ urlpatterns = patterns('webchat.chat.views',
('^a/message/updates$', 'message_updates')) ('^a/message/updates$', 'message_updates'))
urlpatterns += patterns('django.views.static', urlpatterns += patterns('django.views.static',
(r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'), 'serve', (r'^%s(?P<path>.*)$' % settings.MEDIA_URL.lstrip('/'), 'serve',
{'document_root': settings.MEDIA_ROOT, {'document_root': settings.MEDIA_ROOT,
'show_indexes': True})) 'show_indexes': True}))
...@@ -611,7 +611,11 @@ class TestInternational(TestCase): ...@@ -611,7 +611,11 @@ class TestInternational(TestCase):
def test(self): def test(self):
sock = self.connect() sock = self.connect()
sock.sendall('GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n') sock.sendall('''GET /%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82?%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81=%D0%BE%D1%82%D0%B2%D0%B5%D1%82 HTTP/1.1
Host: localhost
Connection: close
'''.replace('\n', '\r\n'))
read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0) read_http(sock.makefile(), reason='PASSED', chunks=False, body='', content_length=0)
......
...@@ -287,13 +287,17 @@ def match_line(line, command): ...@@ -287,13 +287,17 @@ def match_line(line, command):
def matches(expected, command): def matches(expected, command):
""" """
>>> matches(["* * C:\Python27\python.exe -u -m monkey_test --Event test_threading.py"], "C:\Python27\python.exe -u -m monkey_test --Event test_threading.py") >>> matches(["* * C:\Python27\python.exe -u -m monkey_test --Event test_threading.py"],
... "C:\Python27\python.exe -u -m monkey_test --Event test_threading.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.5-dbg -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.5-dbg -u -m monkey_test --Event test_urllib2net.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.5 -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.5 -u -m monkey_test --Event test_urllib2net.py")
True True
>>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'], "/usr/bin/python2.6 -u -m monkey_test --Event test_urllib2net.py") >>> matches(['* * /usr/bin/python2.5(-dbg)? -u -m monkey_test --Event test_urllib2net.py'],
... "/usr/bin/python2.6 -u -m monkey_test --Event test_urllib2net.py")
False False
>>> matches(['* GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 python -u test__subprocess.py'], >>> matches(['* GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 python -u test__subprocess.py'],
... "GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 GEVENT_FILE=thread python -u test__subprocess.py") ... "GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 GEVENT_FILE=thread python -u test__subprocess.py")
......
...@@ -388,7 +388,9 @@ def simplify_tags(tags): ...@@ -388,7 +388,9 @@ def simplify_tags(tags):
>>> simplify_tags([set([('defined(world)', True), ('defined(hello)', True)]), >>> simplify_tags([set([('defined(world)', True), ('defined(hello)', True)]),
... set([('defined(world)', False), ('defined(hello)', True)])]) ... set([('defined(world)', False), ('defined(hello)', True)])])
[set([('defined(hello)', True)])] [set([('defined(hello)', True)])]
>>> simplify_tags([set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', True)]), set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', False)]), set([('defined(_WIN32)', False), ('defined(LIBEV_EMBED)', False)]), set([('defined(LIBEV_EMBED)', False), ('defined(_WIN32)', True)])]) >>> simplify_tags([set([('defined(LIBEV_EMBED)', True), ('defined(_WIN32)', True)]), set([('defined(LIBEV_EMBED)', True),
... ('defined(_WIN32)', False)]), set([('defined(_WIN32)', False), ('defined(LIBEV_EMBED)', False)]),
... set([('defined(LIBEV_EMBED)', False), ('defined(_WIN32)', True)])])
[] []
""" """
if not isinstance(tags, list): if not isinstance(tags, list):
...@@ -741,8 +743,8 @@ def combinations(iterable, r): ...@@ -741,8 +743,8 @@ def combinations(iterable, r):
else: else:
return return
indices[i] += 1 indices[i] += 1
for j in range(i+1, r): for j in range(i + 1, r):
indices[j] = indices[j-1] + 1 indices[j] = indices[j - 1] + 1
yield tuple(pool[i] for i in indices) yield tuple(pool[i] for i in indices)
...@@ -752,7 +754,7 @@ def product(*args, **kwds): ...@@ -752,7 +754,7 @@ def product(*args, **kwds):
pools = tuple(map(tuple, args)) * kwds.get('repeat', 1) pools = tuple(map(tuple, args)) * kwds.get('repeat', 1)
result = [[]] result = [[]]
for pool in pools: for pool in pools:
result = [x+[y] for x in result for y in pool] result = [x + [y] for x in result for y in pool]
for prod in result: for prod in result:
yield tuple(prod) yield tuple(prod)
......
...@@ -68,13 +68,13 @@ elif not args: ...@@ -68,13 +68,13 @@ elif not args:
system('scp %(source)s %(script_path)s %(username)s@%(host)s:' % options.__dict__) system('scp %(source)s %(script_path)s %(username)s@%(host)s:' % options.__dict__)
if options.dist: if options.dist:
system('ssh %(username)s@%(host)s %(python)s -u %(script_name)s dist %(source_name)s' % options.__dict__) system('ssh %(username)s@%(host)s %(python)s -u %(script_name)s dist %(source_name)s' % options.__dict__)
try: try:
os.mkdir('dist') os.mkdir('dist')
except OSError: except OSError:
pass pass
system('scp -r %(username)s@%(host)s:%(dir_name)s/dist/ dist' % options.__dict__) system('scp -r %(username)s@%(host)s:%(dir_name)s/dist/ dist' % options.__dict__)
else: else:
system('ssh %(username)s@%(host)s C:/Python27/python.exe -u %(script_name)s test %(source_name)s' % options.__dict__) system('ssh %(username)s@%(host)s C:/Python27/python.exe -u %(script_name)s test %(source_name)s' % options.__dict__)
else: else:
sys.exit('Invalid args: %r' % (args, )) sys.exit('Invalid args: %r' % (args, ))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment