| Class: EditableFile | ./src/peak/storage/files.py | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
File whose text can be manipulated, transactionallyExample:
myfile = EditableFile(self, filename="something")
print myfile.text # prints current contents of file
# Edit the file
storage.beginTransaction(self)
myfile.text = myfile.text.replace('foo','bar')
storage.commitTransaction(self)
Values assigned to By default, files are read and written in "text" mode; be sure to supply
a
|