~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/util.py

  • Committer: William Grant
  • Date: 2010-02-26 08:06:58 UTC
  • Revision ID: grantw@unimelb.edu.au-20100226080658-a57yf98u8smthfym
Update role docs with per-exercise worksheet completion stats, and note that lecturers hold the policy-specific tutor permissions regardless of the policy setting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        # Incomplete
198
198
        return count
199
199
 
200
 
def object_to_dict(attrnames, obj):
201
 
    """Convert an object into a dictionary.
202
 
 
203
 
    This takes a shallow copy of the object.
204
 
 
205
 
    @param attrnames: Set (or iterable) of names of attributes to be copied
206
 
                      into the dictionary. (We don't auto-lookup, because this
207
 
                      function needs to be used on magical objects).
208
 
    """
209
 
    return dict((k, getattr(obj, k))
210
 
        for k in attrnames if not k.startswith('_'))
211
 
 
212
200
def safe_rmtree(path, ignore_errors=False, onerror=None):
213
201
    """Recursively delete a directory tree.
214
202