コード例 #1
0
ファイル: srmclient.py プロジェクト: chStaiger/ACES-Training
class Downloader(threading.Thread):
    def __init__(self, queue):
        threading.Thread.__init__(self)
        self.q = queue
        self.logger = logging.getLogger('Pindel')
        self.srm = SRMClient(self.logger)
        self.daemon = False
    
    def run(self):
        while not self.q.empty():
            f = self.q.get()
            count = 0
            done = False
            while(count < 10 and not done):
                try:
                    self.srm.download(f)
                    done = True
                except:
                    count += 1
            if(count > 9):
                raise EnvironmentError("Download failed.")
            self.q.task_done()
        print "Exeting while loop, thread should close itself..."
コード例 #2
0
ファイル: srmclient.py プロジェクト: natalieda/tropomi2grid
class Downloader(threading.Thread):
    def __init__(self, queue):
        threading.Thread.__init__(self)
        self.q = queue
        self.logger = logging.getLogger('Pindel')
        self.srm = SRMClient(self.logger)
        self.daemon = False

    def run(self):
        while not self.q.empty():
            f = self.q.get()
            count = 0
            done = False
            while (count < 10 and not done):
                try:
                    self.srm.download(f)
                    done = True
                except:
                    count += 1
            if (count > 9):
                raise EnvironmentError("Download failed.")
            self.q.task_done()
        print "Exeting while loop, thread should close itself..."
コード例 #3
0
ファイル: srmclient.py プロジェクト: chStaiger/ACES-Training
 def __init__(self, queue):
     threading.Thread.__init__(self)
     self.q = queue
     self.logger = logging.getLogger('Pindel')
     self.srm = SRMClient(self.logger)
     self.daemon = False
コード例 #4
0
ファイル: srmclient.py プロジェクト: natalieda/tropomi2grid
 def __init__(self, queue):
     threading.Thread.__init__(self)
     self.q = queue
     self.logger = logging.getLogger('Pindel')
     self.srm = SRMClient(self.logger)
     self.daemon = False