def gather_report(self): storage_name = str(self.ui.chooseStorage.currentText()) vertical_dimension = str(self.ui.chooseVerticalDimension.currentText()) horizontal_dimension = str(self.ui.chooseHorizontalDimension.currentText()) if vertical_dimension == horizontal_dimension: raise Exception('Build report error: You must specify different ' 'horizontal and vertical dimensions') return current_storage = self.name2storage[storage_name] report = Report() report.setStorage(current_storage) report.setHorizontalDimension(current_storage.getDimensionByName(horizontal_dimension)) report.setVerticalDimension(current_storage.getDimensionByName(vertical_dimension)) report.setFilters(self.gather_filters()) return report
def main(): storages = parseConfigFile() for storageName in storages: storage = storages[storageName] print storage.path report = Report() report.setStorage(storage) report.setHorizontalDimension(storage.getDimensionByName("Shops")) report.setVerticalDimension(storage.getDimensionByName("Customers")) fKinds = EqualityFilter(["ranetki",], storage.getDimensionByName("Kinds")) f = InequalityFilter(storage.getDimensionByName('Customers'), {'from':'kolesov93', 'to':'kolesov93'}) report.setFilters([f, fKinds]) report.saveToFile("ololo.xml") print report.executeQuery() report = Report() report.initFromFile("reports/inequalityReport.xml", storages) print report.executeQuery()