aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--export.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/export.py b/export.py
index e9c668a..bdccf7a 100644
--- a/export.py
+++ b/export.py
@@ -2,6 +2,7 @@
import datetime
import itertools
+import json
import os
import re
import sys
@@ -293,6 +294,7 @@ def uname_srcpkgs(data, name):
def export_all(data):
outputdir = 'output'
+ index = {}
if not os.path.exists(outputdir):
os.makedirs(outputdir)
@@ -324,6 +326,7 @@ def export_all(data):
print (name.encode('utf8') if isinstance(name, unicode) else name)
fname = filename(name)
path = os.path.join(outputdir, fname)
+ index[fname] = {'page': name, 'file': fname}
# Generator; exceptions are delayed.
templates = export_srcpkgs(data, name, srcpkgs)
@@ -332,6 +335,9 @@ def export_all(data):
except ExportFailure, e:
warn('export failed: %s: %s' % (name, e.message))
+ path = os.path.join(outputdir, 'index.json')
+ json.dump(index, file(path, 'w'))
+
def main():
data = PkgData()
args = sys.argv[1:]