diff orpg/networking/server_plugins.py @ 71:449a8900f9ac ornery-dev

Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
author sirebral
date Thu, 20 Aug 2009 03:00:39 -0500
parents 4385a7d0efd1
children d1aff41c031b
line wrap: on
line diff
--- a/orpg/networking/server_plugins.py	Tue Aug 18 20:48:36 2009 -0500
+++ b/orpg/networking/server_plugins.py	Thu Aug 20 03:00:39 2009 -0500
@@ -25,7 +25,6 @@
     def initBase(self):
         self._startPlugins()
 
-
     #Methods
     def _startPlugins(self):
         autoload = []
@@ -60,7 +59,6 @@
         self._load(pluginData)
 
         #Write to the autoload file for this plugin
-
         self.__plugins[pluginName].Activated = True
         self.__plugins[pluginName].start()
 
@@ -68,13 +66,12 @@
         if not self.__plugins.has_key(pluginName):
             #Print some error about invalid plugin
             return
+
         pluginData = self.__plugins[pluginName]
-
         self.__plugins[pluginName].stop()
 
         #Unload it
         self._unload(pluginData)
-
         #Remove this plugin from the autoload file
 
     #Private Methods
@@ -84,7 +81,10 @@
         return ('plugins.' + self.__ptype + '.' + s2[0], s2[0])
 
     def _unload(self, pluginData):
-        self.__plugins[pluginData.Name] = PluginData(pluginData.Name, pluginData.File, pluginData.Author, pluginData.Help)
+        self.__plugins[pluginData.Name] = PluginData(pluginData.Name, 
+                                                    pluginData.File, 
+                                                    pluginData.Author, 
+                                                    pluginData.Help)
         unload = []
         mod = self._findModule(pluginData.File)[0]
         for key, module in sys.modules.iteritems():
@@ -115,8 +115,6 @@
 
     def _getType(self):
         return self.__ptype
-
-
     #Properties
     Plugins = property(_getPlugins, None)
     Type = property(_getType, None)
@@ -132,18 +130,15 @@
     def preParseIncoming(self, xml_dom, data):
         sent = True
         errmsg = ""
-
         for pluginName, pluginData in self.Plugins.iteritems():
             if pluginData.Activated:
                 xml_dom, data = pluginData.preParseIncoming(xml_dom, data)
-
         return xml_dom, data
 
     def postParseIncoming(self, data):
         for pluginName, pluginData in self.Plugins.iteritems():
             if pluginData.Activated:
                 data = pluginData.postParseIncoming(data)
-
         return data
 
     def getPlayer(self):
@@ -152,7 +147,6 @@
             if pluginData.Activated:
                 playerName = pluginData.addPlayer(data)
                 players.append(playerName)
-
         return players
 
     def setPlayer(self, playerData):
@@ -161,7 +155,6 @@
             if pluginData.Activated:
                 playerName = pluginData.addPlayer(data)
                 players.append(playerName)
-
         return
 
     def preParseOutgoing(self):
@@ -171,7 +164,6 @@
                 xml = pluginData.preParseOutgoing()
                 for msg in xml:
                     data.append(msg)
-
         return data
 
     def postParseOutgoing(self):
@@ -181,7 +173,6 @@
                 xml = pluginData.postParseOutgoing()
                 for msg in xml:
                     data.append(msg)
-
         return data
 
 __key = _SingletonKey()