Skip to content

DavidCain/LazyCollate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LazyCollate

Each semester, some 70 students enroll in Colby College's CS 151. A student worker is tasked with collating each week's projects into a sensible directory structure, including each student's writeup rendered as a PDF.

I'm lazy, so I wrote a program to automate this procedure.

Working off a project number and a list of students, LazyCollate locates the students' code on a network share and renders Confluence pages using either QtWebKit or PhantomJS. File renaming, content warnings, and web scraping are all done automatically.

Installation and setup

Dependencies

LazyCollate is tested on a GNU/Linux system, but should be cross-platform.

The versions within your operating system's package manager will most likely be fine.

Core dependencies

Configuration

  1. Mount the CS 151 network share to /mnt/CS151 (or elsewhere, but change CS151_MOUNT_POINT in collate.py if you do so).

  2. Optionally change any of the global variables within collate.py.

Instructions

Basic usage:

First, create a file students.txt with each CS151 student's Colby ID on its own line.

Then, to collate project 2, call:

$ python collate.py 2 students.txt

LazyCollate will ask for your password and log in for you. Then, sit back while it does the rest!

Logging

LazyCollate writes out to the comprehensive collation.log. The --verbose flag will ensure that all messages permeate to standard output in addition to this log file.

Other options

To see all available options:

$ python collate.py --help

Maintenance

LazyCollate is designed to work with Atlassian Confluence 3.5.13's login system. If failed login error messages change, or if the HTML login form changes name or field names, writeups.py will need to be modified accordingly.

Cookie-based logins with wkhtmltopdf don't work currently. The active workaround is to just POST the username and password with a redirect for the desired page (such as in save_writeup() in collate.py). See cookie_login() in writeups.py for where cookies should work.

Known bugs

wkhtmltopdf has an issue on OS X with printing Conflence URL's with a POST (passing a recommended flag might help, but it's far easier to just use phantomjs instead).