Example #1
0
	def restartServer(self):
		if platform == "linux" or platform == "linux2":
			actions = self._settings.get(["system", "actions"])
			for a in actions:
				if a['action'] == 'astrobox-restart':
					#Call to Popen will start the restart command but return inmediately before it completes
					threading.Timer(1.0, subprocess.Popen, [a['command'].split(' ')]).start()
					self._logger.info('Restart command scheduled')

					from astroprint.boxrouter import boxrouterManager
					from astroprint.printer.manager import printerManager
					from astroprint.camera import cameraManager
					from astroprint.network.manager import networkManagerShutdown

					#let's be nice about shutthing things down
					boxrouterManager().boxrouter_disconnect()
					printerManager().disconnect()
					cameraManager().close_camera()
					networkManagerShutdown()

					return True

			return False

		return True
Example #2
0
	def cleanup(self):
		global discoveryManager
		
		discoveryManager.shutdown()
		discoveryManager = None
		boxrouterManager().shutdown()
		cameraManager().shutdown()

		from astroprint.network.manager import networkManagerShutdown
		networkManagerShutdown()
Example #3
0
	def cleanup(self):
		global discoveryManager
		
		discoveryManager.shutdown()
		discoveryManager = None
		boxrouterManager().shutdown()
		cameraManager().shutdown()

		from astroprint.network.manager import networkManagerShutdown
		networkManagerShutdown()
		
		logging.getLogger(__name__).info("Goodbye!")
Example #4
0
    def cleanup(self):
        global discoveryManager

        downloadManager().shutdown()
        printerManager().rampdown()
        discoveryManager.shutdown()
        discoveryManager = None
        boxrouterManager().shutdown()
        cameraManager().shutdown()

        from astroprint.network.manager import networkManagerShutdown
        networkManagerShutdown()
Example #5
0
    def restartServer(self):
        if platformStr == "linux" or platformStr == "linux2":
            actions = self._settings.get(["system", "actions"])
            for a in actions:
                if a['action'] == 'astrobox-restart':
                    # Call to Popen will start the restart command but
                    # return inmediately before it completes
                    threading.Timer(1.0, subprocess.Popen,
                                    [a['command'].split(' ')]).start()
                    self._logger.info('Restart command scheduled')

                    from astroprint.printer.manager import printerManager
                    from astroprint.camera import cameraManager
                    from astroprint.network.manager import networkManagerShutdown

                    # let's be nice about shutthing things down
                    printerManager().disconnect()
                    cameraManager().close_camera()
                    networkManagerShutdown()
                    return True
            return False
        return True