Message208991
Django: https://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File
It looks like Django has a File object that wraps around Python's built-in file object. It offers a 'mode' attribute, and a read(num_bytes=None) / write([content]) function. It also offers __iter__ functionality. You must open the file, and then wrap it with File() like:
myfile = File(open('myfile.txt', 'r'))
Twisted: http://twistedmatrix.com/documents/current/api/twisted.python.filepath.FilePath.html
Looking at twisted.python.filepath.FilePath, it looks like there is no read/write.
These are two very popular frameworks/libraries, but I'll see if I can't find other sources for inspiration.
I think read_bytes/read_text would offer a good alternative method for reading files, instead of trying to create a full-on replacement like the previous patches attempt to do. |
|
Date |
User |
Action |
Args |
2014-01-23 20:37:25 | cjwelborn | set | recipients:
+ cjwelborn, pitrou, cool-RR, serhiy.storchaka |
2014-01-23 20:37:24 | cjwelborn | set | messageid: <1390509444.93.0.679704875938.issue20218@psf.upfronthosting.co.za> |
2014-01-23 20:37:24 | cjwelborn | link | issue20218 messages |
2014-01-23 20:37:24 | cjwelborn | create | |
|