def doImport(argv): global config from sharedtools import setupUTF setupUTF() config = RUIANImporterConfig() config.loadFromCommandLine(argv, helpStr) log.createLogger(getDataDirFullPath() + "Download.log") log.logger.info("Importing VFR data to database.") osGeoPath = getOSGeoPath() if not os.path.exists(osGeoPath): print "Error: RUIAN import library %s doesn't exist" % osGeoPath print "Download file %s, expand it into RUIANToolbox base directory and run script again." % RUIAN2PG_LIBRARY_ZIP_URL sys.exit() rebuildAuxiliaryTables = processDownloadedDirectory(getDataDirFullPath()) if config.buildServicesTables and rebuildAuxiliaryTables: from RUIANServices.services.auxiliarytables import buildAll, buildServicesTables if config.buildAutocompleteTables: buildAll() else: buildServicesTables() from RUIANServices.services.RUIANConnection import saveRUIANVersionDateToday saveRUIANVersionDateToday()
def doImport(argv): global config from sharedtools import setupUTF setupUTF() config = RUIANImporterConfig() config.loadFromCommandLine(argv, helpStr) log.createLogger(getDataDirFullPath() + "Download.log") log.logger.info("Importing VFR data to database.") osGeoPath = getOSGeoPath() if not os.path.exists(osGeoPath): print "Error: RUIAN import library %s doesn't exist" % osGeoPath print "Download file %s, expand it into RUIANToolbox base directory and run script again." % RUIAN2PG_LIBRARY_ZIP_URL sys.exit() rebuildAuxiliaryTables = processDownloadedDirectory(getDataDirFullPath()) if config.buildServicesTables and rebuildAuxiliaryTables: from RUIANServices.services.auxiliarytables import buildAll, buildServicesTables if config.buildAutocompleteTables: buildAll() else: buildServicesTables() from RUIANServices.services.RUIANConnection import saveRUIANVersionDateToday saveRUIANVersionDateToday()
addTestByID("/CompileAddress/text?AddressPlaceId=25021478", u"Lesní 345/5\n35301 Mariánské Lázně") addTestByID("/CompileAddress/text?AddressPlaceId=16512171", u"Pašinovice 8\n37401 Komařice") addTestByID("/CompileAddress/text?AddressPlaceId=165k", u"") #ošetření chyby - zadání omylem znaku do identifikátoru addTestByID("/CompileAddress/text?AddressPlaceId=12", u"") #ošetření chyby - zadání identifikátoru, který není v DB addTest(u"Arnošta Valenty", u"670", u"", u"31", u"", u"19800", u"Praha", u"Černý Most", u"9", u"Arnošta Valenty 670/31\nČerný Most\n19800 Praha 9") addTest(u"Arnošta Valenty", u"670", u"", u"", u"", u"198 00", u"Praha", u"Černý Most", u"9", u"Arnošta Valenty 670\nČerný Most\n19800 Praha 9") addTest(u"Medová", u"", u"30", u"", u"", u"10400", u"Praha", u"Křeslice", u"10", u"Medová č.ev. 30\nKřeslice\n10400 Praha 10") addTest(u"", u"", u"42", u"", u"", u"10400", u"Praha", u"Křeslice", u"10", u"Křeslice č.ev. 42\n10400 Praha 10") addTest(u"Lhenická", u"1120", u"", u"1", u"", u"37005", u"České Budějovice", u"České Budějovice 2", u"", u"Lhenická 1120/1\nČeské Budějovice 2\n37005 České Budějovice") addTest(u"Holická", u"568", u"", u"31", u"y", u"779 00", u"Olomouc", u"Hodolany", u"", u"Holická 568/31y\nHodolany\n77900 Olomouc") addTest(u"Na Herinkách", u"85", u"", u"", u"", u"26601", u"Beroun", u"Beroun-Závodí", u"", u"Na Herinkách 85\nBeroun-Závodí\n26601 Beroun") addTest(u"Na Herinkách", u"", u"97", u"", u"", u"26601", u"Beroun", u"Beroun-Závodí", u"", u"Na Herinkách č.ev. 97\nBeroun-Závodí\n26601 Beroun") addTest(u"Žamberecká", u"339", u"", u"", u"", u"51601", u"Vamberk", u"Vamberk", u"", u"Žamberecká 339\n51601 Vamberk") addTest(u"Žamberecká", u"339", u"", u"1", u"", u"51601", u"Vamberk", u"Vamberk", u"", u"Žamberecká 339/1\n51601 Vamberk") addTest(u"Lidická", u"2858", u"", u"49", u"F", u"78701", u"Šumperk", u"Šumperk", u"", u"Lidická 2858/49F\n78701 Šumperk") addTest(u"Žamberecká", u"", u"21", u"", u"", u"51601", u"Vamberk", u"Vamberk", u"", u"Žamberecká č.ev. 21\n51601 Vamberk") addTest(u"", u"106", u"", u"", u"", u"53333", u"Pardubice", u"Dražkovice", u"", u"Dražkovice 106\n53333 Pardubice") addTest(u"", u"", u'32', u'', u"", u"53333", u"Pardubice", u"Dražkovice", u"", u"Dražkovice č.ev. 32\n53333 Pardubice") addTest(u"", u"111", u"", u"", u"", u"50333", u"Praskačka", u"Praskačka", u"", u"č.p. 111\n50333 Praskačka") addTest(u"", u"", u"86", u"", u"", u"53943", u"Krouna", u"Krouna", u"", u"č.ev. 86\n53943 Krouna") tester.closeSection() if testerParam == None: tester.saveToHTML("CompileAddress.html") if __name__ == '__main__': sharedtools.setupUTF() test()
addTest("/NearbyAddresses/textToOneRow/560670/1026662/80", "Kamenička č.ev. 31, 79069 Bílá Voda") addTest("/NearbyAddresses/textToOneRow/697180/1066880/120", "Červený Hrádek 44, 28504 Bečváry") addTest("/NearbyAddresses/text/655180/1030800/50", "č.p. 22\n50315 Pšánky") addTest("/NearbyAddresses/text/625350/1025770/200", "č.p. 54\n55203 Říkov") addTest("/NearbyAddresses/text/724948/1007742/65? ", "č.p. 42\n27735 Kanina\nč.p. 47\n27735 Kanina") addTest("/NearbyAddresses/text/560670/1026662/80", "Kamenička č.ev. 31\n79069 Bílá Voda") addTest("/NearbyAddresses/text/697180/1066880/120", "Červený Hrádek 44\n28504 Bečváry") addTest("/NearbyAddresses/text/a/1025770/200", "") addTest("/NearbyAddresses/text/625350/b/200", "") addTest("/NearbyAddresses/text/625350/1025770/c", "") addTest("/NearbyAddresses/text/a/b/c", "") addTest("/NearbyAddresses/text/a/b/200", "") addTest("/NearbyAddresses/text/625350/b/c", "") addTest("/NearbyAddresses/text/a/1025770/c", "") tester.closeSection() if testerParam == None: tester.saveToHTML("NearByAddresses.html") if __name__ == '__main__': sharedtools.setupUTF() test()