Changeset 2e5dc1b


Ignore:
Timestamp:
Sep 8, 2012, 6:59:23 PM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
9ce8bc1
Parents:
8068f6d
git-author:
Alex Dehnert <adehnert@…> (09/08/12 18:55:03)
git-committer:
Alex Dehnert <adehnert@…> (09/08/12 18:59:23)
Message:

Allow easily listing all constitution filenames

This makes it much easier to go clean them out if you somehow desync the DB's
idea of what exists from the filesystem's idea of what exists.

Just run something like:
ls | sort | comm -23 - <(path/to/gather_constitutions.py list | sort) | xargs git rm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/gather_constitutions.py

    rfb1c047 r2e5dc1b  
    7171        print "%4d\t%s" % (len(gs), code, )
    7272
     73def list_constitutions():
     74    constitutions = groups.models.GroupConstitution.objects.all()
     75    for const in constitutions:
     76        if const.dest_file: print const.dest_file
     77
    7378if __name__ == '__main__':
    7479    if len(sys.argv) == 1 or sys.argv[1] == "gather":
     
    7782    elif sys.argv[1] == "webstat":
    7883        webstat()
     84    elif sys.argv[1] == "list":
     85        list_constitutions()
    7986    else:
    8087        raise NotImplementedError
Note: See TracChangeset for help on using the changeset viewer.