/[circus]/circus/circus/circus.py
ViewVC logotype

Diff of /circus/circus/circus.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by tvon, Sun Nov 17 19:18:51 2002 UTC revision 1.23 by tvon, Sun Nov 17 23:11:15 2002 UTC
# Line 25  __version__ = "$Revision$" Line 25  __version__ = "$Revision$"
25  # base imports  # base imports
26  import sys, os, string  import sys, os, string
27  # circus imports  # circus imports
28  import module, config, display  import module, config, display, actions
29    
30  # Xlib imports  # Xlib imports
31  from Xlib import X, Xutil  from Xlib import X, Xutil
# Line 41  class Ringmaster: Line 41  class Ringmaster:
41      screen = None      screen = None
42      modules = {}      modules = {}
43      module_events = {}      module_events = {}
44        wm_actions = None
45            
46      def __init__(self, config, d = None):      def __init__(self, config, d = None):
47    
48          self.config = config          self.config = config
49            self.wm_actions = actions.WmActions()
50    
51          if d:          if d:
52              self.display = display.Display(d)              self.display = display.Display(d)
# Line 123  class Ringmaster: Line 125  class Ringmaster:
125          sys.stderr.write("]\n")          sys.stderr.write("]\n")
126    
127    
   
128      def _import_name(self, modulename, name):      def _import_name(self, modulename, name):
129          """Utility method to dynamically import modules.          """Utility method to dynamically import modules.
130                    
# Line 169  class Ringmaster: Line 170  class Ringmaster:
170                  except KeyError:                  except KeyError:
171                      self.module_events[e] = [module_name]                      self.module_events[e] = [module_name]
172                            
173              self.modules[module_name].__name__ = module_name              # Add module actions list to WmActions
174                for k, v in self.modules[module_name].my_actions.items():
175                    self.wm_actions.add_action(k, getattr(self.modules[module_name], v))
176                
177                self.modules[module_name].name = module_name
178              self.modules[module_name]._load(self.config, self.display)              self.modules[module_name]._load(self.config, self.display)
179                            
180          # XXX need to specify if the module was not found or if there was an              # XXX need to specify if the module was not found or if there was an
181          # error loading it.  Currently either one raises this error              # error loading it.  Currently either one raises this error
182          except Exception, e:          except Exception, e:
183              sys.stderr.write("Error while loading module '" + module_name + "':\n")              sys.stderr.write("Error while loading module '" + module_name + "':\n")
184              # FIXME: Need to switch this to sys.stderr.write somehow              # FIXME: Need to switch this to sys.stderr.write somehow

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26