Skip to content

Commit 93d41ac

Browse files
committed
Shortened line lengths
1 parent 34738f2 commit 93d41ac

File tree

10 files changed

+20
-10
lines changed

10 files changed

+20
-10
lines changed

intro_to_threading/daemon_thread.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def thread_function(name):
1212

1313
if __name__ == "__main__":
1414
format = "%(asctime)s: %(message)s"
15-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
15+
logging.basicConfig(format=format, level=logging.INFO,
16+
datefmt="%H:%M:%S")
1617

1718
logging.info("Main : before creating thread")
1819
x = threading.Thread(target=thread_function, args=(1,), daemon=True)

intro_to_threading/executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def thread_function(name):
1313

1414
if __name__ == "__main__":
1515
format = "%(asctime)s: %(message)s"
16-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
16+
logging.basicConfig(format=format, level=logging.INFO,
17+
datefmt="%H:%M:%S")
1718

1819
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:
1920
executor.map(thread_function, range(3))

intro_to_threading/fixrace.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def locked_update(self, name):
2626

2727
if __name__ == "__main__":
2828
format = "%(asctime)s: %(message)s"
29-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
29+
logging.basicConfig(format=format, level=logging.INFO,
30+
datefmt="%H:%M:%S")
3031
# logging.getLogger().setLevel(logging.DEBUG)
3132

3233
database = FakeDatabase()

intro_to_threading/multiple_threads.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def thread_function(name):
1212

1313
if __name__ == "__main__":
1414
format = "%(asctime)s: %(message)s"
15-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
15+
logging.basicConfig(format=format, level=logging.INFO,
16+
datefmt="%H:%M:%S")
1617

1718
threads = list()
1819
for index in range(3):

intro_to_threading/prodcom_better_queue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def consumer(queue, event):
3030

3131
if __name__ == "__main__":
3232
format = "%(asctime)s: %(message)s"
33-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
33+
logging.basicConfig(format=format, level=logging.INFO,
34+
datefmt="%H:%M:%S")
3435

3536
pipeline = queue.Queue(maxsize=10)
3637
event = threading.Event()

intro_to_threading/prodcom_event.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def consumer(pipeline, event):
6666

6767
if __name__ == "__main__":
6868
format = "%(asctime)s: %(message)s"
69-
logging.basicConfig(format=format, level=logging.INFO, datefmt='%H:%M:%S')
69+
logging.basicConfig(format=format, level=logging.INFO,
70+
datefmt='%H:%M:%S')
7071
# logging.getLogger().setLevel(logging.DEBUG)
7172

7273
pipeline = Pipeline()

intro_to_threading/prodcom_lock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def consumer(pipeline):
6060

6161
if __name__ == "__main__":
6262
format = "%(asctime)s: %(message)s"
63-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
63+
logging.basicConfig(format=format, level=logging.INFO,
64+
datefmt="%H:%M:%S")
6465
# logging.getLogger().setLevel(logging.DEBUG)
6566

6667
pipeline = Pipeline()

intro_to_threading/prodcom_queue.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def consumer(pipeline, event):
4848

4949
if __name__ == "__main__":
5050
format = "%(asctime)s: %(message)s"
51-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
51+
logging.basicConfig(format=format, level=logging.INFO,
52+
datefmt="%H:%M:%S")
5253
# logging.getLogger().setLevel(logging.DEBUG)
5354

5455
pipeline = Pipeline()

intro_to_threading/racecond.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def update(self, name):
2020

2121
if __name__ == "__main__":
2222
format = "%(asctime)s: %(message)s"
23-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
23+
logging.basicConfig(format=format, level=logging.INFO,
24+
datefmt="%H:%M:%S")
2425

2526
database = FakeDatabase()
2627
logging.info("Testing update. Starting value is %d.", database.value)

intro_to_threading/single_thread.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def thread_function(name):
1212

1313
if __name__ == "__main__":
1414
format = "%(asctime)s: %(message)s"
15-
logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S")
15+
logging.basicConfig(format=format, level=logging.INFO,
16+
datefmt="%H:%M:%S")
1617

1718
logging.info("Main : before creating thread")
1819
x = threading.Thread(target=thread_function, args=(1,))

0 commit comments

Comments
 (0)