]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - src/allmydata/storage/shares.py
Change relative imports to absolute
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / storage / shares.py
1 #! /usr/bin/python
2
3 from allmydata.storage.mutable import MutableShareFile
4 from allmydata.storage.immutable import ShareFile
5
6 def get_share_file(filename):
7     f = open(filename, "rb")
8     prefix = f.read(32)
9     f.close()
10     if prefix == MutableShareFile.MAGIC:
11         return MutableShareFile(filename)
12     # otherwise assume it's immutable
13     return ShareFile(filename)
14