2
0
mirror of https://github.com/WikiTeam/wikiteam synced 2024-11-04 12:00:28 +00:00

fixed error with index.php; add a new content splitter

git-svn-id: https://wikiteam.googlecode.com/svn/trunk@73 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
This commit is contained in:
emijrp 2011-04-12 16:31:50 +00:00
parent f9179049fe
commit 94aa7b0a40

View File

@ -45,10 +45,15 @@ def delay(config={}):
time.sleep(config['delay'])
def cleanHTML(raw=''):
if re.search('<!-- bodytext -->', raw): #<!-- bodytext --> <!-- /bodytext --> <!-- start content --> <!-- end content -->
#<!-- bodytext --> <!-- /bodytext -->
#<!-- start content --> <!-- end content -->
#<!-- Begin Content Area --> <!-- End Content Area -->
if re.search('<!-- bodytext -->', raw):
raw = raw.split('<!-- bodytext -->')[1].split('<!-- /bodytext -->')[0]
elif re.search('<!-- start content -->', raw):
raw = raw.split('<!-- start content -->')[1].split('<!-- end content -->')[0]
elif re.search('<!-- Begin Content Area -->', raw):
raw = raw.split('<!-- Begin Content Area -->')[1].split('<!-- End Content Area -->')[0]
else:
print 'This wiki doesn\'t use marks to split contain'
sys.exit()
@ -612,15 +617,16 @@ Write --help for help."""
#fix add here api.php existence comprobation
pass
#user chosen --api, --index it is neccesary for special:export, we generate it
config['index'] = config['api'].split('api.php')[0] + 'index.php'
#adding http://
if not config['api'].startswith('http://'):
if not config['index'] and not config['api'].startswith('http://'):
config['api'] = 'http://' + config['api']
if not config['index'].startswith('http://'):
if not config['api'] and not config['index'].startswith('http://'):
config['index'] = 'http://' + config['index']
#user chosen --api, --index it is neccesary for special:export, we generate it
if config['api'] and not config['index']:
config['index'] = config['api'].split('api.php')[0] + 'index.php'
#calculating path, if not defined by user with --path=
if not config['path']:
config['path'] = './%s-%s-wikidump' % (domain2prefix(config=config), config['date'])