Merge pull request #366 from shenxiangzhuang/python_pep8
Fix: make python code fellow pep8
This commit is contained in:
commit
3a7f0deafc
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
pika.ConnectionParameters(host='localhost'))
|
pika.ConnectionParameters(host='localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
pika.ConnectionParameters(host='localhost'))
|
pika.ConnectionParameters(host='localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
pika.ConnectionParameters(host='localhost'))
|
pika.ConnectionParameters(host='localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
pika.ConnectionParameters(host='localhost'))
|
pika.ConnectionParameters(host='localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika, sys, os
|
import os
|
||||||
|
import pika
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
|
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
|
||||||
@ -15,6 +18,7 @@ def main():
|
|||||||
print(' [*] Waiting for messages. To exit press CTRL+C')
|
print(' [*] Waiting for messages. To exit press CTRL+C')
|
||||||
channel.start_consuming()
|
channel.start_consuming()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika, sys, os
|
import os
|
||||||
|
import pika
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika, sys, os
|
import os
|
||||||
|
import pika
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
@ -22,11 +25,9 @@ def main():
|
|||||||
|
|
||||||
print(' [*] Waiting for logs. To exit press CTRL+C')
|
print(' [*] Waiting for logs. To exit press CTRL+C')
|
||||||
|
|
||||||
|
|
||||||
def callback(ch, method, properties, body):
|
def callback(ch, method, properties, body):
|
||||||
print(f" [x] {method.routing_key}:{body.decode()}")
|
print(f" [x] {method.routing_key}:{body.decode()}")
|
||||||
|
|
||||||
|
|
||||||
channel.basic_consume(
|
channel.basic_consume(
|
||||||
queue=queue_name, on_message_callback=callback, auto_ack=True)
|
queue=queue_name, on_message_callback=callback, auto_ack=True)
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika, sys, os
|
import os
|
||||||
|
import pika
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
@ -22,11 +25,9 @@ def main():
|
|||||||
|
|
||||||
print(' [*] Waiting for logs. To exit press CTRL+C')
|
print(' [*] Waiting for logs. To exit press CTRL+C')
|
||||||
|
|
||||||
|
|
||||||
def callback(ch, method, properties, body):
|
def callback(ch, method, properties, body):
|
||||||
print(f" [x] {method.routing_key}:{body.decode()}")
|
print(f" [x] {method.routing_key}:{body.decode()}")
|
||||||
|
|
||||||
|
|
||||||
channel.basic_consume(
|
channel.basic_consume(
|
||||||
queue=queue_name, on_message_callback=callback, auto_ack=True)
|
queue=queue_name, on_message_callback=callback, auto_ack=True)
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
|
|
||||||
class FibonacciRpcClient(object):
|
class FibonacciRpcClient(object):
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import pika
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import pika
|
||||||
|
|
||||||
connection = pika.BlockingConnection(
|
connection = pika.BlockingConnection(
|
||||||
pika.ConnectionParameters(host='localhost'))
|
pika.ConnectionParameters(host='localhost'))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
Loading…
Reference in New Issue
Block a user