mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
Apply Python 3 futurize transform lib2to3.fixes.fix_idioms
Refer to #256
This commit is contained in:
committed by
Tim Abbott
parent
ab7287474e
commit
4fb549abe8
@@ -122,7 +122,7 @@ def run_mirror():
|
|||||||
try:
|
try:
|
||||||
# we use an exponential backoff approach when we get 429 (Too Many Requests).
|
# we use an exponential backoff approach when we get 429 (Too Many Requests).
|
||||||
sleepInterval = 1
|
sleepInterval = 1
|
||||||
while 1:
|
while True:
|
||||||
time.sleep(sleepInterval)
|
time.sleep(sleepInterval)
|
||||||
response = requests.get("https://basecamp.com/%s/api/v1/events.json" % (config.BASECAMP_ACCOUNT_ID),
|
response = requests.get("https://basecamp.com/%s/api/v1/events.json" % (config.BASECAMP_ACCOUNT_ID),
|
||||||
params={'since': since},
|
params={'since': since},
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ def run_mirror():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
sleepInterval = 1
|
sleepInterval = 1
|
||||||
while 1:
|
while True:
|
||||||
events = make_api_call("activity")[::-1]
|
events = make_api_call("activity")[::-1]
|
||||||
if events is not None:
|
if events is not None:
|
||||||
sleepInterval = 1
|
sleepInterval = 1
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ for device in macs.values():
|
|||||||
# If you have multiple IPs, local-ipv4s is a list.
|
# If you have multiple IPs, local-ipv4s is a list.
|
||||||
# If you only have one, local-ipv4s is a string.
|
# If you only have one, local-ipv4s is a string.
|
||||||
# Who knew?
|
# Who knew?
|
||||||
if type(device['local-ipv4s']) is str:
|
if isinstance(device['local-ipv4s'], str):
|
||||||
# Only do dhcp, don't try to assign addresses
|
# Only do dhcp, don't try to assign addresses
|
||||||
to_configure = [device['local-ipv4s']]
|
to_configure = [device['local-ipv4s']]
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ users = {}
|
|||||||
|
|
||||||
def gen_next_user():
|
def gen_next_user():
|
||||||
global users
|
global users
|
||||||
user_list = users.keys()
|
user_list = sorted(users.keys())
|
||||||
user_list.sort()
|
|
||||||
while True:
|
while True:
|
||||||
for user in user_list:
|
for user in user_list:
|
||||||
yield user
|
yield user
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class ConnectionHandler:
|
|||||||
self.target.close()
|
self.target.close()
|
||||||
|
|
||||||
def get_base_header(self):
|
def get_base_header(self):
|
||||||
while 1:
|
while True:
|
||||||
self.client_buffer += self.client.recv(BUFLEN)
|
self.client_buffer += self.client.recv(BUFLEN)
|
||||||
end = self.client_buffer.find('\n')
|
end = self.client_buffer.find('\n')
|
||||||
if end!=-1:
|
if end!=-1:
|
||||||
@@ -195,7 +195,7 @@ class ConnectionHandler:
|
|||||||
time_out_max = self.timeout/3
|
time_out_max = self.timeout/3
|
||||||
socs = [self.client, self.target]
|
socs = [self.client, self.target]
|
||||||
count = 0
|
count = 0
|
||||||
while 1:
|
while True:
|
||||||
count += 1
|
count += 1
|
||||||
(recv, _, error) = select.select(socs, [], socs, 3)
|
(recv, _, error) = select.select(socs, [], socs, 3)
|
||||||
if error:
|
if error:
|
||||||
@@ -237,7 +237,7 @@ def start_server(host='localhost', port=PORT, IPv6=False, timeout=60,
|
|||||||
soc.bind((host, port))
|
soc.bind((host, port))
|
||||||
print "Serving on %s:%d." % (host, port) #debug
|
print "Serving on %s:%d." % (host, port) #debug
|
||||||
soc.listen(0)
|
soc.listen(0)
|
||||||
while 1:
|
while True:
|
||||||
thread.start_new_thread(handler, soc.accept()+(timeout,))
|
thread.start_new_thread(handler, soc.accept()+(timeout,))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user