aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDafydd Harries <daf@rhydd.org>2013-05-23 05:38:08 -0400
committerDafydd Harries <daf@rhydd.org>2013-05-23 05:38:08 -0400
commitc40fd5b88195ac92047a618b31263f34a6e73598 (patch)
tree56588b4e95901db5a215a157990dbb084baef264
parentae21ecd58535c030ec1c367bb7715550d9a5015c (diff)
export.py: add a few comments/docstrings
This hopefully makes the structure/flow a little clearer.
-rw-r--r--export.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/export.py b/export.py
index bc4c53a..a50894d 100644
--- a/export.py
+++ b/export.py
@@ -12,6 +12,7 @@ import pandas as pd
import license
+# Package fields which refer to download locations.
download_keys = """
Origin
Original-Source
@@ -206,6 +207,11 @@ def extract_resources(cp_header):
('Resource URL', cp_header[key])])
def export_srcpkgs(data, name, srcpkg_names):
+ """Export a package by reference to its constituent source packages.
+
+ This coordinates all the information that goes into a particular page.
+ """
+
# Map source package names to binary packages, and also make note
# of which versions of those source packages we're looking at.
binpkgs = pd.concat([
@@ -302,6 +308,8 @@ def output(path, xs):
f.write(str(x) + '\n')
def output_multi(path, xs):
+ "Output a bunch of pages to a directory with an index."
+
index = {}
if not os.path.exists(path):
@@ -322,6 +330,11 @@ def uname_srcpkgs(data, name):
return srcpkg_names
def export_all(data):
+ """Export all packages.
+
+ Returns a generator of (name, templates) tuples.
+ """
+
# First, find all upstream names and the source packages corresponding
# to them.