File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ def run(self):
96
96
self .thumbServer = httpThumbnailServer (self .server_address , httpThumbnailHandler )
97
97
self .thumbServer .serve_forever (0.5 )
98
98
99
+ def __init__ (self ):
100
+ Thread .__init__ (self )
101
+ self .server_address = None
102
+
99
103
100
104
class httpThumbnailHandler (BaseHTTPRequestHandler ):
101
105
""" This class handles HTTP requests to the HTTP thumbnail server above."""
Original file line number Diff line number Diff line change 29
29
30
30
import os
31
31
import sys
32
+ import time
32
33
from copy import deepcopy
33
34
from functools import partial
34
35
from random import uniform
@@ -166,6 +167,11 @@ def page_ready(self):
166
167
def get_thumb_address (self ):
167
168
"""Return the thumbnail HTTP server address"""
168
169
thumb_server_details = get_app ().window .http_server_thread .server_address
170
+ while not thumb_server_details :
171
+ log .info ('No HTTP thumbnail server found yet... keep waiting...' )
172
+ time .sleep (0.25 )
173
+ thumb_server_details = get_app ().window .http_server_thread .server_address
174
+
169
175
thumb_address = "http://%s:%s/thumbnails/" % (thumb_server_details [0 ], thumb_server_details [1 ])
170
176
return thumb_address
171
177
You can’t perform that action at this time.
0 commit comments