Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on June 19, 2014 at 02:15 PM

Section 1 (Text)

[13:54]	<+ElementalAlchemist> 	Anyway
[13:54]	<+ElementalAlchemist> 	HeufyCloud: https://github.com/ElementalAlchemist/txircd/blob/dev/0.3/txircd/ircd.py#L102
[13:54]	<PyMoronBot> 		txircd/txircd/ircd.py at dev/0.3 · ElementalAlchemist/txircd · GitHub (at github.com)
[13:54]	<+ElementalAlchemist> 	Specifically those first two
[13:54]	* 			Tyranic-Moron wonders if his highlight string would work as a searchnick term
[13:54]	<+HeufyCloud> 		I noticed that
[13:54]	<+ElementalAlchemist> 	The second one looks a little roundabout but that's how it goes
[13:54]	<+HeufyCloud> 		Can you do live reloading though?
[13:55]	<+ElementalAlchemist> 	Yes.
[13:55]	<+HeufyCloud> 		I think that was our main concern
[13:55]	<+ElementalAlchemist> 	https://github.com/ElementalAlchemist/txircd/blob/dev/0.3/txircd/ircd.py#L240
[13:55]	<PyMoronBot> 		txircd/txircd/ircd.py at dev/0.3 · ElementalAlchemist/txircd · GitHub (at github.com)
[13:55]	<+ElementalAlchemist> 	If you scroll down past _loadModuleData
[13:55]	<+ElementalAlchemist> 	which is huge and specific to txircd
[13:55]	<+ElementalAlchemist> 	I guess unloadModule is also a bit specific to txircd
[13:56]	<+HeufyCloud> 		Because I thought Twisted kept all its plugins loaded
[13:56]	<+ElementalAlchemist> 	I don't think it does
[13:56]	<+ElementalAlchemist> 	I think it just gets all of them
[13:56]	<+HeufyCloud> 		Hmmm
[13:56]	<+HeufyCloud> 		That would make sense
[13:56]	<+ElementalAlchemist> 	Or if it does, when you call getPlugins it updates them
[13:56]	<+HeufyCloud> 		It's mainly so we can modify and add modules while the bot is running
[13:57]	<+ElementalAlchemist> 	But I don't think it does, so when you don't save any of the module data, the refcount drops to zero and it's basically unloaded
[13:57]	<+HeufyCloud> 		hmmm
[13:57]	<+HeufyCloud> 		ElementalAlchemist: That would make sense yes. We just have to figure out how we're gonna handle data loading then
[13:58]	<+ElementalAlchemist> 	Alright
[13:59]	<+HeufyCloud> 		We're gonna give it a go and see what happens
[13:59]	<+ElementalAlchemist> 	:)
[13:59]	<+HeufyCloud> 		If all else fails we can always go back to importlib
[13:59]	<+HeufyCloud> 		:P
[13:59]	<+ElementalAlchemist> 	:/
[13:59]	<+ElementalAlchemist> 	I'd imagine you can get away with taking the five relevant txircd functions and pulling the txircd-specific parts out of _loadModuleData and unloadModule
[14:00]	<+ElementalAlchemist> 	Well, I guess the first requires your loaded modules to be under the "modules" key as well
[14:00]	<+ElementalAlchemist> 	in the configuration
[14:01]	<+HeufyCloud> 		I looked at _loadModuleData
[14:01]	<+HeufyCloud> 		It just loads all the modes/command/etc. into a dictionary right?
[14:01]	<+ElementalAlchemist> 	Basically, getPlugins returns a list of module objects (up to date) which you can then use to save module objects (depending on how your module API is set up)
[14:01]	<+HeufyCloud> 		Sooo
[14:02]	<+ElementalAlchemist> 	HeufyCloud: Multiple dictionaries, but otherwise yes
[14:02]	<+HeufyCloud> 		If we just remove a module from our list of loaded modules it should clean itself up?
[14:02]	<+HeufyCloud> 		As long as all references to it are gone?
[14:02]	<+ElementalAlchemist> 	Yes.
[14:02]	<+Mara> 			Sounds like a sensible thing
[14:02]	<+HeufyCloud> 		That's actually fairly easy then
[14:02]	<+ElementalAlchemist> 	Assuming twisted doesn't cache it--but if it does, then it takes up a little bit of memory, but it does nothing else
[14:03]	<+ElementalAlchemist> 	And considering getPlugins returns new stuff every time, I don't see the point to caching if it does
[14:04]	<+ElementalAlchemist> 	As I assume you realized, that's where your interface class and module package go, too :P
[14:04]	<+HeufyCloud> 		yes