Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 08e0dc2

Browse filesBrowse files
committed
Make examples' output quiet by default
1 parent d162e54 commit 08e0dc2
Copy full SHA for 08e0dc2

File tree

Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed

‎examples/browser.py

Copy file name to clipboardExpand all lines: examples/browser.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import logging
77
import socket
8+
import sys
89
from time import sleep
910

1011
from zeroconf import ServiceBrowser, ServiceStateChange, Zeroconf
@@ -31,7 +32,9 @@ def on_service_state_change(zeroconf, service_type, name, state_change):
3132

3233
if __name__ == '__main__':
3334
logging.basicConfig(level=logging.DEBUG)
34-
logging.getLogger('zeroconf').setLevel(logging.DEBUG)
35+
if len(sys.argv) > 1:
36+
assert sys.argv[1:] == ['--debug']
37+
logging.getLogger('zeroconf').setLevel(logging.DEBUG)
3538

3639
zeroconf = Zeroconf()
3740
print("\nBrowsing services, press Ctrl-C to exit...\n")

‎examples/registration.py

Copy file name to clipboardExpand all lines: examples/registration.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
import logging
66
import socket
7+
import sys
78
from time import sleep
89

910
from zeroconf import ServiceInfo, Zeroconf
1011

1112
if __name__ == '__main__':
1213
logging.basicConfig(level=logging.DEBUG)
13-
logging.getLogger('zeroconf').setLevel(logging.DEBUG)
14+
if len(sys.argv) > 1:
15+
assert sys.argv[1:] == ['--debug']
16+
logging.getLogger('zeroconf').setLevel(logging.DEBUG)
1417

1518
desc = {'path': '/~paulsm/'}
1619

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.