Exemplo n.º 1
0
    def __init__(self):
        log = FigdocLogger()

        # print message to the screen as well as here
        print "FigDoc grabber (FTP) service starting. Use Ctrl-C to end"
        log.write_info("Grabber (FTP) service starting up. Use Ctrl-C to end.")

        # get the config
        try:
            self._config = figConfig.get_config("grabber")
            GrabberService._interval = self._config["interval"]
            GrabberService._from_location = self._config["fromDir"]
            GrabberService._to_location = self._config["toDir"]
        except IOError as e:
            print "There was an error getting the Grabber Service configuration. Please contact you system administrator"
Exemplo n.º 2
0
        elif routing_flag == 'PO':
            # create PDF
            # connect to DMS
            pass

        else:
            # we have an error
            # email the configured account details and log everything
            pass

#
# This is the recommended entry point for Figdocs
#
if __name__ == '__main__':
    log = FigdocLogger()
    log.write_info("Starting mainService.")
    print "Starting main Figdoc service."

    # create a new thread for the FTP process
    log.write_info("Creating a new thread for the grabbers")
    grab = GrabberService()
    thread = Thread(target=grab.go())
    thread.start()
    thread.join()

    run_it = Service()

    try:
        while True:
            run_it.get_next_file_and_process(run_it.location)