comparison MoinMoin/config/multiconfig.py @ 1210:a31940162a32

merge with main
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Mon, 31 Jul 2006 12:24:50 +0200
parents 73f576c4bca3 2aa53ed0afa0
children 84f94820d612
comparison
equal deleted inserted replaced
1209:017deaab4afd 1210:a31940162a32
5 @copyright: 2000-2004 by Jürgen Hermann <jh@web.de>, 5 @copyright: 2000-2004 by Jürgen Hermann <jh@web.de>,
6 2005-2006 by MoinMoin:ThomasWaldmann. 6 2005-2006 by MoinMoin:ThomasWaldmann.
7 @license: GNU GPL, see COPYING for details. 7 @license: GNU GPL, see COPYING for details.
8 """ 8 """
9 9
10 import re, os, sys 10 import re
11 from MoinMoin import error 11 import os
12 import sys
13 import time
14
15 from MoinMoin import error, util, wikiutil
12 import MoinMoin.auth as authmodule 16 import MoinMoin.auth as authmodule
17 from MoinMoin.packages import packLine
13 18
14 _url_re_cache = None 19 _url_re_cache = None
15 _farmconfig_mtime = None 20 _farmconfig_mtime = None
16 _config_cache = {} 21 _config_cache = {}
17 22
546 # list to cache xapian searcher objects 551 # list to cache xapian searcher objects
547 self.xapian_searchers = [] 552 self.xapian_searchers = []
548 553
549 # check if mail is possible and set flag: 554 # check if mail is possible and set flag:
550 self.mail_enabled = (self.mail_smarthost is not None or self.mail_sendmail is not None) and self.mail_from 555 self.mail_enabled = (self.mail_smarthost is not None or self.mail_sendmail is not None) and self.mail_from
556
557 self.meta_dict = wikiutil.MetaDict(os.path.join(data_dir, 'meta'), self.cache_dir)
558
559 # interwiki ID processing
560 self.load_IWID()
561
562 def load_IWID(self):
563 """ Loads the InterWikiID of this instance. It is used to identify the instance
564 globally.
565 The IWID is available as cfg.iwid
566 The full IWID containing the interwiki name is available as cfg.iwid_full
567 """
568
569 try:
570 iwid = self.meta_dict['IWID']
571 except KeyError:
572 iwid = util.random_string(16).encode("hex") + "-" + str(int(time.time()))
573 self.meta_dict['IWID'] = iwid
574 self.meta_dict.sync()
575
576 self.iwid = iwid
577 if self.interwikiname is not None:
578 self.iwid_full = packLine([iwid, self.interwikiname])
579 else:
580 self.iwid_full = packLine([iwid])
551 581
552 def _config_check(self): 582 def _config_check(self):
553 """ Check namespace and warn about unknown names 583 """ Check namespace and warn about unknown names
554 584
555 Warn about names which are not used by DefaultConfig, except 585 Warn about names which are not used by DefaultConfig, except