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

« back to all changes in this revision

Viewing changes to ivle/util.py

  • Committer: Matt Giuca
  • Date: 2010-02-23 05:18:48 UTC
  • Revision ID: matt.giuca@gmail.com-20100223051848-8kxdsitlvkeyl4gt
Added handlers and documentation for Subversion status 'ignored' (we call them 'Temporary file (ignored)'. This was previously handled as an 'unknown status'. Ignored files now can't have svn actions done on them either. This fixes Launchpad bug #526220.

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
 
200
212
def safe_rmtree(path, ignore_errors=False, onerror=None):
201
213
    """Recursively delete a directory tree.
202
214