def updateDb(self):

        print 'Updating database'
        missing = self._missingDates()

        for i, date in enumerate(missing):
            source = downloadUrl(date)

            dest = os.path.join(self.dataDir,date2fileName(date))
            if not os.path.exists(dest):
                print 'Downloading [%i/%i]' %(i,len(missing)), source
                urllib.urlretrieve(source, dest)
            else:
                print 'x',
        print 'Update done.'
        self._checkDates()
dataset/ETHPy150Open sjev/trading-with-python/lib/bats.py/BATS_Data.updateDb/original