~james-w/pkgme/extra_files_from_paths

« back to all changes in this revision

Viewing changes to pkgme/package_files.py

  • Committer: James Westby
  • Date: 2012-01-10 14:48:35 UTC
  • Revision ID: james.westby@canonical.com-20120110144835-85a53hqxpvd04g1v
Add a docstring to FileFromDisk. Thanks jml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
 
47
47
class FileFromDisk(object):
 
48
    """A file that takes its contents from a file on disk."""
48
49
 
49
50
    def __init__(self, target_path, source_path, overwrite=True, elements=None):
 
51
        """Create a FileFromDisk.
 
52
 
 
53
        :param target_path: the path that the file should be written to.
 
54
        :param source_path: the path that the contents should be read from.
 
55
        :param overwrite: whether to overwrite the target file if it is
 
56
            present. Default is True.
 
57
        :param elements: The InfoElements needed for the content of this
 
58
            file. Default is None meaning no elements.
 
59
        """
50
60
        self.path = target_path
51
61
        self.source_path = source_path
52
62
        self.overwrite = overwrite