pynedm.fileutils

File utilities

class pynedm.fileutils.AttachmentFile(req)[source]

Provides a file-like object for handling document attachments without downloading them.

Returned by pynedm.utils.ProcessObject.open_file()

iterate(chunk_size)[source]

Iterates from this current position to the end of the file

Parameters:chunk_size (int) – number of bytes in chunk to yield
read(numbytes=-1)[source]

Read number of bytes from current position

Parameters:numbytes (int) – number of bytes to read (< 0 reads remaining bytes)
seek(seekpos, whence=0)[source]

Seek to a position in the file

Parameters:
  • seekpos (int) – seek position
  • whence – direction (0 - from beginning, 1 - relative to current position, 2 - from end)
tell()[source]

Get the current position

Returns:int - current position