MCPcopy Create free account
hub / github.com/ActiveState/code / module_thread

Class module_thread

recipes/Python/302592_Threaded_FTP_Client/recipe-302592.py:153–170  ·  view source on GitHub ↗

For each module that is downloaded a thread of this class is invoked, so that each of the module that is to be downloaded is done in parallel

Source from the content-addressed store, hash-verified

151
152
153class module_thread(threading.Thread):
154 """ For each module that is downloaded a thread of this class is invoked, so
155 that each of the module that is to be downloaded is done in parallel
156 """
157 def __init__(self, module):
158 self.module=module
159 self.config=config
160 self.machine_list=config.find_subscribed_machines_for_module(module)
161 self.location=config.find_location_for_module( module, 'stage_location')
162 threading.Thread.__init__(self)
163
164 def run(self):
165 try:
166 download_distribute(self.module, self.machine_list, self.config)
167 except:
168 logger.error("[" +self.module + "]FTP Process for this module terminated as error")
169 logger.error("Error:" + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
170 download_status[module_id] = "FAILED"
171
172class config_file_util:
173 """ The class to handle all the configiration file related infornation

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected