#!/usr/bin/python
# Copyright (C) 2008 One Laptop Per Child Association, Inc.
# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details.
#
# written by Douglas Bagnall <douglas@paradise.net.nz>

"""Read activity.info files from a directory full of activity bundles
and write an appropriate html manifest of the most recent versions.
The manifest uses the OLPC activity microformat:

 http://wiki.laptop.org/go/Activity_microformat

This is put in a place where apache can find it, and apache will serve
it and the activities to the laptops.  Messages go to /var/log/user.log.
"""

import xs_activities
import sys, os

try:
    directory = sys.argv[1]
    os.stat(directory)
except (IndexError, OSError):
    print __doc__
    print "USAGE: %s DIRECTORY" % sys.argv[0]
    sys.exit(1)

xs_activities.htmlise_bundles(directory, os.path.join(directory, 'index.html'))


