refactored opening of files to with blocks

previously you were neglecting to close many of your file opens. by refactoring
to with blocks we can ensure that this files are always closed.
removed unused import, global keyword

you only need the `global` keyword when you want to either mutate a global
variable or create a global variable. since you specify you aren't going to be
changing either of them, it isn't necessary
fixed logic bug from operator precedence problem

previously we had:
    if "Total" or "Free" in entry

This expression will always evaluate to True. The reason for this can be seen
by reading http://docs.python.org/2/reference/expressions.html

Since `in` has a higher precedence than `or` the original expression is
equivalent to:
    if "Total" or ("Free" in entry)

Due to any non-empty string being evaluated as boolean True, the original
expression is always True.

One possible fix to this is to do:
    if "Total" in entry or "Free" in entry

but that is fragile and doesn't extend well. The best way to check for if one
of a series of strings is a substring is by using the `any` operator as changed
in the code to:

if any(word in entry for word in ("True", "Free")