Exemple #1
0
	def __init__(self):
		for test in SCRATCH_TESTS:
			self.DEFAULT_TEST_CONFIG[test[0]] = test[2]
	
		AbstractPlugin.__init__(self, 
			"Scratch2Parser", 
			"Joseph Lewis <*****@*****.**>", 
			0.1, 
			"BSD 3 Clause", 
			self.DEFAULT_CONFIG, 
			self.DEFAULT_TEST_CONFIG)
	def __init__(self):
		
		# append all possible tests to the default config
		for name, val, fun, t, f in SCRATCH_FUNCTIONS:
			self.DEFAULT_TEST_CONFIG[name] = val
		
		
		AbstractPlugin.__init__(self, 
					"Scratch Grader", 
					"Joseph Lewis <*****@*****.**>", 
					0.1, 
					"BSD 3 Clause",
					self.DEFAULT_CONFIG,
					self.DEFAULT_TEST_CONFIG)
Exemple #3
0
	def update_config(self, *args):
		'''Called when the configuration for the plugin has been updated from
		another source.
		'''
		AbstractPlugin.update_config(self, *args)
		print("http2 updating config {}".format(self._config))
		try:
			shutdown_server()
		except RuntimeError:
			pass # not running yet.
		
		self._logger.info("Starting HTTP2 Server on Port: http://{host}:{port}".format(**self._config))
		background_thread = threading.Thread(target=app.run, kwargs={'host':self._config['host'], 'port':self._config['port'], 'threaded':True})
		background_thread.daemon = True
		background_thread.start()
Exemple #4
0
	def update_config(self, *args):
		'''Called when the configuration for the plugin has been updated from
		another source.
		'''
		AbstractPlugin.update_config(self, *args)

		if not self._config['enabled']:
			if self._http_server != None:
				self._http_server.shutdown()
			return
		
		self._logger.info("Starting HTTP Server on Port: http://{host}:{port}".format(**self._config))
		background_thread = threading.Thread(target=self._start_web_server)
		background_thread.daemon = True
		background_thread.start()
		
		self._logger.info("Server online and active")
Exemple #5
0
	def setup(self, *args):
		AbstractPlugin.setup(self, *args)
		self._magpie.call_function(self.task, 1)
Exemple #6
0
	def __init__(self):
		AbstractPlugin.__init__(self, "SMTP Frontend", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", self.DEFAULT_CONFIG, {})
Exemple #7
0
	def __init__(self):
		AbstractPlugin.__init__(self,
			"Basic Upload", 
			"Joseph Lewis <*****@*****.**>", 
			0.1, 
			"BSD 3 Clause",{},{'enabled':True})
Exemple #8
0
	def __init__(self):
		Handler._frontend_instance = self
		AbstractPlugin.__init__(self, "HTTP", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", self.DEFAULT_CONFIG, {})
Exemple #9
0
	def __init__(self):
		global frontend_instance
		AbstractPlugin.__init__(self, "HTTP2", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", DEFAULT_CONFIG, {})
		frontend_instance = self