Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes | Properties
MoinMoin.config.multiconfig.DefaultConfig Class Reference
Inheritance diagram for MoinMoin.config.multiconfig.DefaultConfig:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.config.multiconfig.DefaultConfig:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def calc_secrets
def load_meta_dict
def make_iwid_property
def make_event_handlers_prop
def load_IWID
def __getitem__

Public Attributes

 data_dir
 language_default
 logo_string
 chart_options
 auth_methods
 navi_bar
 xapian_search
 notification_server
 url_prefix_action
 url_prefix_local
 url_prefix_fckeditor
 secrets

Static Public Attributes

 cfg_mtime = None
 siteid = None
 cache = None
 mail_enabled = None
 jabber_enabled = None
 auth_can_logout = None
 auth_have_login = None
 auth_login_inputs = None
 xapian_searchers = None
 moinmoin_dir = None
 shared_intermap_files = None
tuple iwid = make_iwid_property("_iwid")
tuple iwid_full = make_iwid_property("_iwid_full")
tuple event_handlers = make_event_handlers_prop()

Properties

 meta_dict = property(load_meta_dict)

Detailed Description

Configuration base class with default config values
    (added below)

Definition at line 643 of file multiconfig.py.


Member Function Documentation

def MoinMoin.config.multiconfig.ConfigFunctionality.__getitem__ (   self,
  item 
) [inherited]
Make it possible to access a config object like a dict 

Definition at line 638 of file multiconfig.py.

00638 
00639     def __getitem__(self, item):
00640         """ Make it possible to access a config object like a dict """
00641         return getattr(self, item)
00642 

Here is the caller graph for this function:

make up some 'secret' using some config values 

Definition at line 404 of file multiconfig.py.

00404 
00405     def calc_secrets(self):
00406         """ make up some 'secret' using some config values """
00407         varnames = ['data_dir', 'data_underlay_dir', 'language_default',
00408                     'mail_smarthost', 'mail_from', 'page_front_page',
00409                     'theme_default', 'sitename', 'logo_string',
00410                     'interwikiname', 'user_homewiki', 'acl_rights_before', ]
00411         secret = ''
00412         for varname in varnames:
00413             var = getattr(self, varname, None)
00414             if isinstance(var, (str, unicode)):
00415                 secret += repr(var)
00416         return secret

Loads the InterWikiID of this instance. It is used to identify the instance
    globally.
    The IWID is available as cfg.iwid
    The full IWID containing the interwiki name is available as cfg.iwid_full
    This method is called by the property.

Definition at line 449 of file multiconfig.py.

00449 
00450     def load_IWID(self):
00451         """ Loads the InterWikiID of this instance. It is used to identify the instance
00452             globally.
00453             The IWID is available as cfg.iwid
00454             The full IWID containing the interwiki name is available as cfg.iwid_full
00455             This method is called by the property.
00456         """
00457         try:
00458             iwid = self.meta_dict['IWID']
00459         except KeyError:
00460             iwid = util.random_string(16).encode("hex") + "-" + str(int(time.time()))
00461             self.meta_dict['IWID'] = iwid
00462             self.meta_dict.sync()
00463 
00464         self._iwid = iwid
00465         if self.interwikiname is not None:
00466             self._iwid_full = packLine([iwid, self.interwikiname])
00467         else:
00468             self._iwid_full = packLine([iwid])

Here is the call graph for this function:

Here is the caller graph for this function:

The meta_dict contains meta data about the wiki instance. 

Definition at line 418 of file multiconfig.py.

00418 
00419     def load_meta_dict(self):
00420         """ The meta_dict contains meta data about the wiki instance. """
00421         if self._meta_dict is None:
00422             self._meta_dict = wikiutil.MetaDict(os.path.join(self.data_dir, 'meta'), self.cache_dir)
        return self._meta_dict

Definition at line 437 of file multiconfig.py.

00437 
00438     def make_event_handlers_prop():
00439         def getter(self):
00440             if self._event_handlers is None:
00441                 self._event_handlers = events.get_handlers(self)
00442             return self._event_handlers
00443 
00444         def setter(self, new_handlers):
00445             self._event_handlers = new_handlers
00446 
        return property(getter, setter)

Definition at line 426 of file multiconfig.py.

00426 
00427     def make_iwid_property(attr):
00428         def getter(self):
00429             if getattr(self, attr, None) is None:
00430                 self.load_IWID()
00431             return getattr(self, attr)
        return property(getter)

Here is the call graph for this function:


Member Data Documentation

Definition at line 223 of file multiconfig.py.

Definition at line 224 of file multiconfig.py.

Definition at line 225 of file multiconfig.py.

Definition at line 327 of file multiconfig.py.

Definition at line 220 of file multiconfig.py.

Definition at line 218 of file multiconfig.py.

Definition at line 307 of file multiconfig.py.

Reimplemented in MoinMoin._tests.wikiconfig.Config.

Definition at line 249 of file multiconfig.py.

Definition at line 447 of file multiconfig.py.

Definition at line 432 of file multiconfig.py.

Definition at line 433 of file multiconfig.py.

Definition at line 222 of file multiconfig.py.

Definition at line 291 of file multiconfig.py.

Reimplemented in MoinMoin._tests.wikiconfig.Config.

Definition at line 295 of file multiconfig.py.

Definition at line 221 of file multiconfig.py.

Definition at line 230 of file multiconfig.py.

Definition at line 334 of file multiconfig.py.

Definition at line 357 of file multiconfig.py.

Definition at line 377 of file multiconfig.py.

Definition at line 232 of file multiconfig.py.

Definition at line 219 of file multiconfig.py.

Definition at line 368 of file multiconfig.py.

Definition at line 374 of file multiconfig.py.

Definition at line 371 of file multiconfig.py.

Definition at line 341 of file multiconfig.py.

Definition at line 229 of file multiconfig.py.


Property Documentation

Definition at line 423 of file multiconfig.py.


The documentation for this class was generated from the following file: