Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools/mergeupdates.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mergeupdates.py')
-rwxr-xr-xtools/mergeupdates.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/mergeupdates.py b/tools/mergeupdates.py
index 4533e2c..0462a47 100755
--- a/tools/mergeupdates.py
+++ b/tools/mergeupdates.py
@@ -9,6 +9,7 @@ END_TEXT = chr(3)
def process_article(title, text):
fpath = os.path.join(wikidir, title)
if os.path.exists(fpath):
+ sys.stderr.write('Merging %s\n' % fpath)
fc = open(fpath).read()
fc = re.sub('^\n+', '', fc)
fc = re.sub('\n+$', '', fc)
@@ -22,19 +23,24 @@ def process_article(title, text):
buf = ''
mode = 'title'
-wikidir = sys.argv[1]
+wikidir = os.path.join(sys.argv[1], 'wiki')
+if not os.path.exists(wikidir):
+ print "Does not exist: " + wikidir
+ sys.exit(1)
while True:
b = sys.stdin.read(1)
if not b:
break
if b == START_HEADING:
+ #sys.stderr.write('d start heading\n')
pass
elif b == START_TEXT:
buf = re.sub('^\n+', '', buf)
title = buf.split('\n')[0]
bytes = buf.split('\n')[1]
buf = ''
+ #sys.stderr.write('d start text\n')
elif b == END_TEXT:
buf = re.sub('^\n+', '', buf)
buf = re.sub('\n+$', '', buf)