annotate Resources/Samples/Python/HighPerformanceAutoRouting.py @ 3789:3ba143353f95 transcoding

integration mainline->transcoding
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 20 Mar 2020 12:38:00 +0100
parents 94f4a18a79cc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #!/usr/bin/python
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
747
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
4 # Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1288
diff changeset
5 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1288
6e7e5ed91c2d upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1184
diff changeset
6 # Department, University Hospital of Liege, Belgium
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3340
diff changeset
7 # Copyright (C) 2017-2020 Osimis S.A., Belgium
747
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
8 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
9 # This program is free software: you can redistribute it and/or
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
10 # modify it under the terms of the GNU General Public License as
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
11 # published by the Free Software Foundation, either version 3 of the
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
12 # License, or (at your option) any later version.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
13 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
14 # This program is distributed in the hope that it will be useful, but
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
17 # General Public License for more details.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
18 #
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
19 # You should have received a copy of the GNU General Public License
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
21
44382c8bcd15 added explicit licensing terms for samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 413
diff changeset
22
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
2032
65b1ce7cb84f Replaced "localhost" by "127.0.0.1", as it might impact performance on Windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1900
diff changeset
24 URL = 'http://127.0.0.1:8042'
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 TARGET = 'sample'
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 # This sample code shows how to setup a simple, high-performance DICOM
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 # auto-routing. All the DICOM instances that arrive inside Orthanc
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 # will be sent to a remote modality. A producer-consumer pattern is
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 # used. The target modality is specified by the TARGET variable above:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 # It must match an entry in the Orthanc configuration file inside the
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 # "DicomModalities" section.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 # NOTE: This sample only works with Orthanc >= 0.5.2. Make sure that
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 # Orthanc was built with "-DCMAKE_BUILD_TYPE=Release" to get the best
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 # performance.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 import Queue
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 import sys
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 import time
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 import threading
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 import RestToolbox
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 # Queue that is shared between the producer and the consumer
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 # threads. It holds the instances that are still to be sent.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 queue = Queue.Queue()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 # The producer thread. It monitors the arrival of new instances into
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 # Orthanc, and pushes their ID into the shared queue. This code is
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 # based upon the "ChangesLoop.py" sample code.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 def Producer(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 current = 0
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 r = RestToolbox.DoGet(URL + '/changes', {
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 'since' : current,
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 'limit' : 4 # Retrieve at most 4 changes at once
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 })
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 for change in r['Changes']:
3340
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
73 # We are only interested in the arrival of new instances
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 if change['ChangeType'] == 'NewInstance':
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 queue.put(change['ID'])
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 current = r['Last']
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 if r['Done']:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 time.sleep(1)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 # The consumer thread. It continuously reads the instances from the
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 # queue, and send them to the remote modality. Each time a packet of
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 # instances is sent, a single DICOM connexion is used, hence improving
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 # the performance.
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 def Consumer(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 TIMEOUT = 0.1
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 instances = []
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 try:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 # Block for a while, waiting for the arrival of a new
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 # instance
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 instance = queue.get(True, TIMEOUT)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 # A new instance has arrived: Record its ID
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 instances.append(instance)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 queue.task_done()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 except Queue.Empty:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 # Timeout: No more data was received
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 break
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 if len(instances) > 0:
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
111 print('Sending a packet of %d instances' % len(instances))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 start = time.time()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 # Send all the instances with a single DICOM connexion
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 RestToolbox.DoPost('%s/modalities/sample/store' % URL, instances)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 # Remove all the instances from Orthanc
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 for instance in instances:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 RestToolbox.DoDelete('%s/instances/%s' % (URL, instance))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
413
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
121 # Clear the log of the exported instances (to prevent the
1143
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 747
diff changeset
122 # SQLite database from growing indefinitely). More simply,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 747
diff changeset
123 # you could also set the "LogExportedResources" option to
1144
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1143
diff changeset
124 # "false" in the configuration file since Orthanc 0.8.3.
413
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
125 RestToolbox.DoDelete('%s/exports' % URL)
47d63c941902 clearing /exports and /changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 404
diff changeset
126
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 end = time.time()
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
128 print('The packet of %d instances has been sent in %d seconds' % (len(instances), end - start))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 # Thread to display the progress
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 def PrintProgress(queue):
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 while True:
1184
4e9d517503ae port to Python3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1144
diff changeset
137 print('Current queue size: %d' % (queue.qsize()))
404
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 time.sleep(1)
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 # Start the various threads
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 progress = threading.Thread(None, PrintProgress, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 progress.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 progress.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 producer = threading.Thread(None, Producer, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 producer.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 producer.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 consumer = threading.Thread(None, Consumer, None, (queue, ))
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 consumer.daemon = True
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 consumer.start()
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 # Active waiting for Ctrl-C
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 #
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 while True:
4b9a7010b1ea sample of routing
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 time.sleep(0.1)