class documentation

class File(FSObjectBase): (source)

Known subclasses: zim.newfs.mock.MockFile

View In Hierarchy

Base class for folder implementations. Cannot be intatiated directly; use one of the subclasses instead. Main use outside of this module is to check isinstance(object, Folder).
Method __init__ Undocumented
Method __iter__ Undocumented
Method isimage No summary
Method mimetype No summary
Method read Undocumented
Method read_binary Undocumented
Method read_with_etag Undocumented
Method readline Undocumented
Method readlines Undocumented
Method readlines_with_etag Undocumented
Method size Undocumented
Method touch Undocumented
Method verify_etag Undocumented
Method write Undocumented
Method write_binary Undocumented
Method write_with_etag Undocumented
Method writelines Undocumented
Method writelines_with_etag Undocumented
Method _copyto Undocumented
Method _read_with_etag Undocumented
Method _write_decoration Undocumented
Method _write_with_etag Undocumented
Instance Variable _mimetype Undocumented

Inherited from FSObjectBase:

Method copyto Undocumented
Method ctime Undocumented
Method exists Undocumented
Method isequal No summary
Method iswritable Undocumented
Method moveto Undocumented
Method mtime Undocumented
Method parent Undocumented
Method remove Undocumented
Instance Variable watcher Undocumented
Method _cleanup Undocumented
Method _moveto Undocumented
Method _set_mtime Undocumented

Inherited from FilePath (via FSObjectBase):

Class Method new_from_zim_config Returns a new object based on the string representation for that path
Method __eq__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method commonparent Undocumented
Method get_abspath No summary
Method get_childpath Undocumented
Method ischild Undocumented
Method parents Undocumented
Method relpath Undocumented
Method serialize_zim_config Returns the file path as string for serializing the object
Class Variable __slots__ Undocumented
Instance Variable islocal Undocumented
Instance Variable path Undocumented
Instance Variable pathnames Undocumented
Property basename Undocumented
Property dirname Undocumented
Property uri Undocumented
Property userpath Undocumented
def __init__(self, path, endofline=_EOL): (source)
def __iter__(self): (source)

Undocumented

def isimage(self): (source)
Check if this is an image file. Convenience method that works even when no real mime-type suport is available. If this method returns True it is no guarantee this image type is actually supported by Gtk.
Returns
True when this is an image file
def mimetype(self): (source)
Get the mime-type for this file. Will use the XDG mimetype system if available, otherwise fallsback to the standard library mimetypes.
Returns
the mimetype as a string, e.g. "text/plain"
def read(self, size=-1): (source)

Undocumented

def read_binary(self): (source)

Undocumented

def read_with_etag(self): (source)

Undocumented

def readline(self, size=-1): (source)

Undocumented

def readlines(self): (source)

Undocumented

def readlines_with_etag(self): (source)

Undocumented

def size(self): (source)

Undocumented

def touch(self): (source)

Undocumented

def verify_etag(self, etag): (source)

Undocumented

def write(self, text): (source)

Undocumented

def write_binary(self, data): (source)

Undocumented

def write_with_etag(self, text, etag): (source)

Undocumented

def writelines(self, lines): (source)

Undocumented

def writelines_with_etag(self, lines, etag): (source)

Undocumented

def _copyto(self, other): (source)

Undocumented

def _read_with_etag(self, func): (source)

Undocumented

@contextlib.contextmanager
def _write_decoration(self): (source)

Undocumented

def _write_with_etag(self, func, content, etag): (source)

Undocumented

_mimetype = (source)

Undocumented