Package daklib :: Module upload :: Class HashedFile
[hide private]
[frames] | no frames]

Class HashedFile

source code

file with checksums

Instance Methods [hide private]
 
__init__(self, filename, size, md5sum, sha1sum, sha256sum, section=None, priority=None, input_filename=None) source code
 
check(self, directory)
Validate hashes
source code
 
check_fh(self, fh) source code
Class Methods [hide private]
HashedFile
from_file(cls, directory, filename, section=None, priority=None)
create with values for an existing file
source code
Instance Variables [hide private]
str filename
name of the file
str input_filename
name of the file on disk
long size
size in bytes
str md5sum
MD5 hash in hexdigits
str sha1sum
SHA1 hash in hexdigits
str sha256sum
SHA256 hash in hexdigits
str or None section
section or None
str of None priority
priority or None
Method Details [hide private]

from_file(cls, directory, filename, section=None, priority=None)
Class Method

source code 

create with values for an existing file

Create a HashedFile object that refers to an already existing file.

Parameters:
  • directory (str) - directory the file is located in
  • filename (str) - filename
  • section (str or None) - optional section as given in .changes files
  • priority (str or None) - optional priority as given in .changes files
Returns: HashedFile
HashedFile object for the given file

check(self, directory)

source code 

Validate hashes

Check if size and hashes match the expected value.

Parameters:
  • directory (str) - directory the file is located in
Raises:

Instance Variable Details [hide private]

input_filename

name of the file on disk

Used for temporary files that should not be installed using their on-disk name.

Type:
str