コード例 #1
0
    def insertServiceLocationOnDatabase(self, service, direction):
        """ load service location data by service with direction """

        log = open('loadDataErrorTest.log', 'w')

        csv = open('InitialData/servicelocation.csv', 'r')
        csv.next()
        factory = TestLoaderFactory()
        loader = factory.getModelLoader('servicelocation')(csv, log)
        loader.load(service + direction)
        csv.close()
        log.close()
コード例 #2
0
    def insertBusstopsOnDatabase(self, busStopList):
        """ load bus stops """

        log = open('loadDataErrorTest.log', 'w')

        csv = open('InitialData/busstop.csv', 'r')  # path to Bus Stop csv file
        csv.next()
        factory = TestLoaderFactory()
        loader = factory.getModelLoader('busstop')(csv, log)
        loader.load(busStopList)
        csv.close()
        log.close()
コード例 #3
0
    def insertEventsOnDatabase(self):
        """ loads events """

        log = open('loadDataErrorTest.log', 'w')

        csv = open('InitialData/events.csv', 'r')  # path to Bus Stop csv file
        csv.next()
        factory = TestLoaderFactory()
        loader = factory.getModelLoader('event')(csv, log)
        loader.load()
        csv.close()
        log.close()
コード例 #4
0
    def insertServicesOnDatabase(self, serviceList):
        """ load services """

        log = open('loadDataErrorTest.log', 'w')

        # path to Bus Stop csv file
        csv = open('InitialData/services.csv', 'r')
        csv.next()
        factory = TestLoaderFactory()
        loader = factory.getModelLoader('service')(csv, log)
        loader.load(serviceList)
        csv.close()
        log.close()