def runForKL(self): ''' 执行考拉的统计任务 :return: ''' #根据系统统计文件大小 audio_dir = ConfUtil.getKLAudioDir() image_dir = ConfUtil.getKLImageDir() res = defaultdict() res['totalAudioSize(bytes)'] = getDirSize(audio_dir) res['totalImageSize(bytes)'] = getDirSize(image_dir) #根据数据库统计专辑与媒体文件的数量 res['totalAlbumCount'] = self.klSt.getAlbumCount() res['totalAudioCount'] = self.klSt.getAudioCount() res['audioCountPerCategory'] = self.klSt.getAudioCountPerCategory() res['albumCountPerCategory'] = self.klSt.getAlbumCountPerCategory() return res
def testConfUtil(self): self.assertEqual(ConfUtil.getQTAudioDir(),'/var/crawler/qt/audios/full') self.assertEqual( ConfUtil.getKLAudioDir(),'/var/crawler/kl/audios/full' )