Changeset 189:2d89178707a0 for src


Ignore:
Timestamp:
05/17/12 17:39:21 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added script to create an archive of the differences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/update.py

    r129 r189  
    4242        for (path, (size, sum)) in self._files.iteritems():
    4343            yield (path, size, sum)
     44
     45    def copy(self):
     46        """Create a copy of the manifest."""
     47        manifest = Manifest()
     48        manifest._files = self._files.copy()
     49        return manifest
    4450       
    4551    def addFile(self, path, size, sum):
     
    99105       
    100106        return (modifiedAndNew, removed)
     107
     108    def __contains__(self, path):
     109        """Determine if the given path is in the manifest."""
     110        return path in self._files
     111
     112    def __getitem__(self, path):
     113        """Get data of the file with the given path."""
     114        return self._files[path] if path in self._files else None
    101115           
    102116#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.