コード例 #1
0
ファイル: __init__.py プロジェクト: josephlewis42/magpie
	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)
コード例 #2
0
	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)
コード例 #3
0
ファイル: __init__.py プロジェクト: josephlewis42/magpie
	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()
コード例 #4
0
ファイル: hypertext.py プロジェクト: josephlewis42/magpie
	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")
コード例 #5
0
ファイル: smtp.py プロジェクト: josephlewis42/magpie
	def setup(self, *args):
		AbstractPlugin.setup(self, *args)
		self._magpie.call_function(self.task, 1)
コード例 #6
0
ファイル: smtp.py プロジェクト: josephlewis42/magpie
	def __init__(self):
		AbstractPlugin.__init__(self, "SMTP Frontend", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", self.DEFAULT_CONFIG, {})
コード例 #7
0
ファイル: upload_basic.py プロジェクト: josephlewis42/magpie
	def __init__(self):
		AbstractPlugin.__init__(self,
			"Basic Upload", 
			"Joseph Lewis <*****@*****.**>", 
			0.1, 
			"BSD 3 Clause",{},{'enabled':True})
コード例 #8
0
ファイル: hypertext.py プロジェクト: josephlewis42/magpie
	def __init__(self):
		Handler._frontend_instance = self
		AbstractPlugin.__init__(self, "HTTP", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", self.DEFAULT_CONFIG, {})
コード例 #9
0
ファイル: __init__.py プロジェクト: josephlewis42/magpie
	def __init__(self):
		global frontend_instance
		AbstractPlugin.__init__(self, "HTTP2", "Joseph Lewis <*****@*****.**>", 0.1, "BSD 3 Clause", DEFAULT_CONFIG, {})
		frontend_instance = self