Example #1
0
    def run(self):
        scanner.scan(self.package, self.serverOnly)
        if not self.serverOnly:
            bundleComponent.produceMonoliths()

        if not self.compileOnly:
            self.startServer()
            self.watch()
Example #2
0
 def watch(self):
     observer = Observer()
     handler = _ChangeHandler(self)
     handler.watch = observer.schedule(handler, path=routing.filepath(''), recursive=True)
     observer.start()
     try:
         while True:
             time.sleep(0.1)
             with LOCK:
                 if not self.serverOnly:
                     if handler.viewChanged:
                         bundleComponent.produceMonoliths()
                         handler.viewChanged = False
                 if handler.serverChanged:
                     self.restartServer()
                     handler.serverChanged = False
     except KeyboardInterrupt:
         observer.stop()
     observer.join()
     self.stopServer()