def path(sheet): """ Returns a sheet's filesystem path """ return sheets.get()[sheet]
def exists_in_default_path(sheet): """ Predicate that returns true if the sheet exists in default_path""" default_path_sheet = os.path.join(sheets.default_path(), sheet) return sheet in sheets.get() and os.access(default_path_sheet, os.R_OK)
def is_writable(sheet): """ Predicate that returns true if the sheet is writeable """ return sheet in sheets.get() and os.access(path(sheet), os.W_OK)
def exists(sheet): """ Predicate that returns true if the sheet exists """ return sheet in sheets.get() and os.access(path(sheet), os.R_OK)