def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() # parse parameters parameters={} start = data.find('<dtml-comment>') end = data.find('</dtml-comment>') if start==-1 or end==-1 or start>end: raise ValueError,'Could not find parameter block' block = data[start+14:end] for line in block.split('\n'): pair = line.split(':',1) if len(pair)!=2: continue parameters[pair[0].strip().lower()]=pair[1].strip() # check for required parameters try: connection_id = ( parameters.get('connection id', '') or parameters['connection_id'] ) except KeyError,e: raise ValueError("The '%s' parameter is required " "but was not supplied" % e)
def _changed(self): mtime = 0 filelist = [] try: fp = expandpath(self.filepath) mtime = stat(fp)[8] if sys.platform == 'nt': # some Windows directories don't change mtime # when a file is added to or deleted from them :-( # So keep a list of files as well, and see if that # changes path.walk(fp, _walker, filelist) filelist.sort() except: LOG('DirectoryView', ERROR, 'Error checking for directory modification', error=exc_info()) if mtime != self._v_last_read or filelist != self._v_last_filelist: self._v_last_read = mtime self._v_last_filelist = filelist return 1 return 0
def getContents(self, registry): changed = 0 if Globals.DevelopmentMode: try: mtime = stat(expandpath(self.filepath))[8] except: mtime = 0 if mtime != self._v_last_read: self._v_last_read = mtime changed = 1 if self.data is None or changed: try: self.data, self.objects = self.prepareContents(registry, register_subdirs=changed) except: from zLOG import LOG, ERROR import sys, traceback type,value,tb = sys.exc_info() LOG( 'DirectoryView' , ERROR , 'Error during prepareContents:' , traceback.format_exception( type, value, tb ) ) self.data = {} self.objects = () return self.data, self.objects
def _changed(self): try: mtime = stat(expandpath(self.filepath))[8] except: mtime = 0 if mtime != self._v_last_read: self._v_last_read = mtime return 1 return 0
def getContents(self, registry): changed = 0 if Globals.DevelopmentMode: try: mtime = stat(expandpath(self.filepath))[8] except: mtime = 0 if mtime != self._v_last_read: self._v_last_read = mtime changed = 1 if self.data is None or changed: try: self.data, self.objects = self.prepareContents( registry, register_subdirs=changed) except: from zLOG import LOG, ERROR import sys, traceback type, value, tb = sys.exc_info() LOG('DirectoryView', ERROR, 'Error during prepareContents:', traceback.format_exception(type, value, tb)) self.data = {} self.objects = () return self.data, self.objects
def _changed(self): mtime = 0 filelist = [] try: fp = expandpath(self.filepath) mtime = stat(fp)[8] # some Windows directories don't change mtime # when a file in them changes :-( # So keep a list of files as well, and see if that # changes path.walk(fp, _walker, filelist) filelist.sort() except: from zLOG import LOG, ERROR import sys LOG('DirectoryView', ERROR, 'Error checking for directory modification', error=sys.exc_info()) if mtime != self._v_last_read or filelist != self._v_last_filelist: self._v_last_read = mtime self._v_last_filelist = filelist return 1 return 0
def _changed(self): mtime=0 filelist=[] try: fp = expandpath(self.filepath) mtime = stat(fp)[8] # some Windows directories don't change mtime # when a file is added to or deleted from them :-( # So keep a list of files as well, and see if that # changes path.walk(fp,_walker,filelist) filelist.sort() except: LOG('DirectoryView', ERROR, 'Error checking for directory modification', error=exc_info()) if mtime != self._v_last_read or filelist != self._v_last_filelist: self._v_last_read = mtime self._v_last_filelist = filelist return 1 return 0
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() # parse parameters parameters = {} start = data.find('<dtml-comment>') end = data.find('</dtml-comment>') if start == -1 or end == -1 or start > end: raise ValueError, 'Could not find parameter block' block = data[start + 14:end] for line in block.split('\n'): pair = line.split(':', 1) if len(pair) != 2: continue parameters[pair[0].strip().lower()] = pair[1].strip() # check for required an optional parameters try: title = parameters.get('title', '') connection_id = parameters.get('connection id', parameters['connection_id']) arguments = parameters.get('arguments', '') max_rows = parameters.get('max_rows', 1000) max_cache = parameters.get('max_cache', 100) cache_time = parameters.get('cache_time', 0) except KeyError, e: raise ValueError, "The '%s' parameter is required but was not supplied" % e
def _updateFromFS(self): if Globals.DevelopmentMode: fp = expandpath(self._filepath) try: mtime=stat(fp)[8] except: mtime=0 if mtime != self._file_mod_time: self._file_mod_time = mtime self._readFile(1)
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'rb') try: data = file.read() finally: file.close() if reparse or self.content_type == 'unknown/unknown': self.ZCacheable_invalidate() self.content_type=self._get_content_type(file, data, self.id) return data
def _updateFromFS(self): parsed = self._parsed if not parsed or Globals.DevelopmentMode: fp = expandpath(self._filepath) try: mtime=stat(fp)[8] except: mtime=0 if not parsed or mtime != self._file_mod_time: self._parsed = 1 self._file_mod_time = mtime self._readFile(1)
def _readFileAsResourceOrDirect(self): """ Return our file's bits, looking in the appropriate place. """ if self._filepath is None: return resource_string(self._package, self._entry_subpath) else: fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: return file.read() finally: file.close()
def _readFile(self, reparse): """Read the data from the filesystem. Read the file (indicated by exandpath(self._filepath), and parse the data if necessary. """ fp = expandpath(self._filepath) file = open(fp, 'rU') try: data = file.read() finally: file.close() if reparse: self._write(data, reparse)
def _updateFromFS(self): parsed = self._parsed if not parsed or Globals.DevelopmentMode: fp = expandpath(self._filepath) try: mtime=stat(fp)[8] except: mtime=0 if not parsed or mtime != self._file_mod_time: # if we have to read the file again, remove the cache self.ZCacheable_invalidate() self._readFile(1) self._file_mod_time = mtime self._parsed = 1
def __init__(self, id, filepath, fullname=None, properties=None): if properties: # Since props come from the filesystem, this should be # safe. self.__dict__.update(properties) self.id = id self._filepath = filepath fp = expandpath(self._filepath) try: self._file_mod_time = stat(fp)[8] except: pass self._readFile(0)
def _readFile(self, reparse): """Read the data from the filesystem. Read the file (indicated by exandpath(self._filepath), and parse the data if necessary. """ warn( 'FSProperties objects will disappear in CMF 1.7 - Use ' 'FSMetadata objects instead.', DeprecationWarning) fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: lines = file.readlines() finally: file.close() map = [] lino = 0 for line in lines: lino = lino + 1 line = line.strip() if not line or line[0] == '#': continue try: propname, proptv = line.split(':', 1) #XXX multi-line properties? proptype, propvstr = proptv.split('=', 1) propname = propname.strip() proptype = proptype.strip() propvstr = propvstr.strip() converter = get_converter(proptype, lambda x: x) propvalue = converter(propvstr) # Should be safe since we're loading from # the filesystem. setattr(self, propname, propvalue) map.append({ 'id': propname, 'type': proptype, 'mode': '', 'default_value': propvalue, }) except: raise ValueError, ('Error processing line %s of %s:\n%s' % (lino, fp, line)) self._properties = tuple(map)
def _readFile( self, reparse ): fp = expandpath( self._filepath ) file = open( fp, 'r' ) # not binary, we want CRLF munging here. try: data = file.read() finally: file.close() self.raw = data if reparse: self.cook()
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'rb') try: data = self._data = file.read() finally: file.close() if reparse or self.content_type == 'unknown/unknown': self.ZCacheable_invalidate() ct, width, height = getImageInfo(data) self.content_type = ct self.width = width self.height = height return data
def __init__(self, id, filepath, fullname=None, properties=None): if properties: # Since props come from the filesystem, this should be # safe. self.__dict__.update(properties) self.id = id self.__name__ = id # __name__ is used in traceback reporting self._filepath = filepath fp = expandpath(self._filepath) try: self._file_mod_time = stat(fp)[8] except: pass self._readFile(0)
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'rb') try: data = self._data = file.read() finally: file.close() if reparse or self.content_type == 'unknown/unknown': self.ZCacheable_invalidate() ct, width, height = getImageInfo( data ) self.content_type = ct self.width = width self.height = height return data
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() self.raw = data if reparse: self._reading = 1 # Avoid infinite recursion try: self.cook() finally: self._reading = 0
def _readFile(self, reparse): """Read the data from the filesystem. Read the file (indicated by exandpath(self._filepath), and parse the data if necessary. """ warn('FSProperties objects will disappear in CMF 1.7 - Use ' 'FSMetadata objects instead.', DeprecationWarning) fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: lines = file.readlines() finally: file.close() map = [] lino=0 for line in lines: lino = lino + 1 line = line.strip() if not line or line[0] == '#': continue try: propname, proptv = line.split(':',1) #XXX multi-line properties? proptype, propvstr = proptv.split( '=', 1 ) propname = propname.strip() proptype = proptype.strip() propvstr = propvstr.strip() converter = get_converter( proptype, lambda x: x ) propvalue = converter( propvstr ) # Should be safe since we're loading from # the filesystem. setattr(self, propname, propvalue) map.append({'id':propname, 'type':proptype, 'mode':'', 'default_value':propvalue, }) except: raise ValueError, ( 'Error processing line %s of %s:\n%s' % (lino,fp,line) ) self._properties = tuple(map)
def __init__(self, id, filepath, fullname=None, properties=None): if properties: # Since props come from the filesystem, this should be # safe. self.__dict__.update(properties) if fullname and properties.get('keep_extension', 0): id = fullname self.id = id self.__name__ = id # __name__ is used in traceback reporting self._filepath = filepath fp = expandpath(self._filepath) try: self._file_mod_time = stat(fp)[8] except: pass self._readFile(0)
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() if reparse: xml_info = xml_detect_re.match(data) if xml_info: # Smells like xml # set "content_type" from the XML declaration encoding = xml_info.group(1) or 'utf-8' self.content_type = 'text/xml; charset=%s' % encoding self.write(data)
def _readFile( self, reparse ): """Read the data from the filesystem. Read the file indicated by exandpath(self._filepath), and parse the data if necessary. 'reparse' is set when reading the second time and beyond. """ try: fp = expandpath(self._filepath) file = open(fp, 'rb') try: data = self.file_contents = file.read() finally: file.close() except: # No errors of any sort may propagate data = self.file_contents = None #give up return data
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() if reparse: if xml_detect_re.match(data): # Smells like xml self.content_type = 'text/xml' else: try: del self.content_type except (AttributeError, KeyError): pass self.write(data)
def _readFile(self, reparse): """Read the data from the filesystem. Read the file indicated by exandpath(self._filepath), and parse the data if necessary. 'reparse' is set when reading the second time and beyond. """ try: fp = expandpath(self._filepath) file = open(fp, 'rb') try: data = self.file_contents = file.read() finally: file.close() except: data = self.file_contents = None #give up return data
def _readTypesFile(self): ''' Reads the .objects file produced by FSDump. ''' types = {} fp = expandpath(self.filepath) try: f = open(path.join(fp, '.objects'), 'rt') except: pass else: lines = f.readlines() f.close() for line in lines: try: obname, meta_type = split(line, ':') except: pass else: types[strip(obname)] = strip(meta_type) return types
def __init__(self, id, filepath, fullname=None, properties=None): if properties: # Since props come from the filesystem, this should be # safe. self.__dict__.update(properties) if fullname and properties.get('keep_extension', 0): id = fullname cache = properties.get('cache') if cache: self.ZCacheable_setManagerId(cache) self.id = id self.__name__ = id # __name__ is used in traceback reporting self._filepath = filepath fp = expandpath(self._filepath) try: self._file_mod_time = stat(fp)[8] except: pass self._readFile(0)
def getContents(self, registry): changed = 0 if Globals.DevelopmentMode: try: mtime = stat(expandpath(self.filepath))[8] except: mtime = 0 if mtime != self._v_last_read: self._v_last_read = mtime changed = 1 if self.data is None or changed: try: self.data, self.objects = self.prepareContents(registry, register_subdirs=changed) except: LOG('DirectoryView', ERROR, 'Error during prepareContents:', error=exc_info()) self.data = {} self.objects = () return self.data, self.objects
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'r') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() if reparse: # If we already have a content_type set it must come from a # .metadata file and we should always honor that. The content # type is initialized as text/html by default, so we only # attempt further detection if the default is encountered. # One previous misbehavior remains: It is not possible to # force a text./html type if parsing detects it as XML. if getattr(self, 'content_type', 'text/html') == 'text/html': xml_info = xml_detect_re.match(data) if xml_info: # Smells like xml # set "content_type" from the XML declaration encoding = xml_info.group(1) or 'utf-8' self.content_type = 'text/xml; charset=%s' % encoding self.write(data)
def getContents(self, registry): changed = 0 if Globals.DevelopmentMode: try: mtime = stat(expandpath(self.filepath))[8] except: mtime = 0 if mtime != self._v_last_read: self._v_last_read = mtime changed = 1 if self.data is None or changed: try: self.data, self.objects = self.prepareContents( registry, register_subdirs=changed) except: LOG('DirectoryView', ERROR, 'Error during prepareContents:', error=exc_info()) self.data = {} self.objects = () return self.data, self.objects
def _updateFromFS(self, reparse=1): parsed = self._parsed if parsed and not Globals.DevelopmentMode: return if self._filepath: fp = expandpath(self._filepath) try: statinfo = os.stat(fp) size, mtime = statinfo[6], statinfo[8] except: size = mtime = 0 else: size, mtime = _getResourceStatInfo(self._package, self._entry_subpath) if not parsed or mtime != self._file_mod_time: # if we have to read the file again, remove the cache self.ZCacheable_invalidate() data = self._readFile(reparse) self._file_mod_time = mtime self._file_size = size self._parsed = 1
def _readFile(self, reparse): fp = expandpath(self._filepath) file = open(fp, 'rU') # not 'rb', as this is a text file! try: data = file.read() finally: file.close() if reparse: # If we already have a content_type set it must come from a # .metadata file and we should always honor that. The content # type is initialized as text/html by default, so we only # attempt further detection if the default is encountered. # One previous misbehavior remains: It is not possible to # force a text./html type if parsing detects it as XML. if getattr(self, 'content_type', 'text/html') == 'text/html': xml_info = xml_detect_re.match(data) if xml_info: # Smells like xml # set "content_type" from the XML declaration encoding = xml_info.group(1) or 'utf-8' self.content_type = 'text/xml; charset=%s' % encoding self.write(data)
def prepareContents(self, registry, register_subdirs=0): # Creates objects for each file. fp = expandpath(self.filepath) data = {} objects = [] types = self._readTypesFile() for entry in _filtered_listdir(fp): if not self._isAllowableFilename(entry): continue e_filepath = path.join(self.filepath, entry) e_fp = expandpath(e_filepath) if path.isdir(e_fp): # Add a subdirectory only if it was previously registered, # unless register_subdirs is set. info = registry.getDirectoryInfo(e_filepath) if info is None and register_subdirs: # Register unknown subdirs registry.registerDirectoryByPath(e_fp) info = registry.getDirectoryInfo(e_filepath) if info is not None: mt = types.get(entry) t = None if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = DirectoryView ob = t(entry, e_filepath) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) else: pos = rfind(entry, '.') if pos >= 0: name = entry[:pos] ext = path.normcase(entry[pos + 1:]) else: name = entry ext = '' if not name or name == 'REQUEST': # Not an allowable id. continue mo = bad_id(name) if mo is not None and mo != -1: # Both re and regex formats # Not an allowable id. continue t = None mt = types.get(entry, None) if mt is None: mt = types.get(name, None) if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = registry.getTypeByExtension(ext) if t is not None: properties = self._readProperties( e_fp + '.properties') try: ob = t(name, e_filepath, fullname=entry, properties=properties) except: import traceback typ, val, tb = exc_info() try: exc_lines = traceback.format_exception( typ, val, tb ) LOG( 'DirectoryView', ERROR, join( exc_lines, '\n' ) ) ob = BadFile( name, e_filepath, exc_str=join( exc_lines, '\r\n' ), fullname=entry ) finally: tb = None # Avoid leaking frame! # FS-based security try: permissions = self._readSecurity(e_fp + '.security') if permissions is not None: for name in permissions.keys(): acquire,roles = permissions[name] ob.manage_permission(name,roles,acquire) except: LOG('DirectoryView', ERROR, 'Error setting permission from .security file information', error=exc_info()) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) return data, tuple(objects)
def prepareContents(self, registry, register_subdirs=0): # Creates objects for each file. fp = expandpath(self.filepath) data = {} objects = [] types = self._readTypesFile() for entry in _filtered_listdir(fp): if not self._isAllowableFilename(entry): continue e_filepath = path.join(self.filepath, entry) e_fp = expandpath(e_filepath) if path.isdir(e_fp): # Add a subdirectory only if it was previously registered, # unless register_subdirs is set. info = registry.getDirectoryInfo(e_filepath) if info is None and register_subdirs: # Register unknown subdirs registry.registerDirectoryByPath(e_fp) info = registry.getDirectoryInfo(e_filepath) if info is not None: mt = types.get(entry) t = None if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = DirectoryView ob = t(entry, e_filepath) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) else: pos = rfind(entry, '.') if pos >= 0: name = entry[:pos] ext = path.normcase(entry[pos + 1:]) else: name = entry ext = '' if not name or name == 'REQUEST': # Not an allowable id. continue mo = bad_id(name) if mo is not None and mo != -1: # Both re and regex formats # Not an allowable id. continue t = None mt = types.get(entry, None) if mt is None: mt = types.get(name, None) if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = registry.getTypeByExtension(ext) if t is not None: properties = self._readProperties(e_fp + '.properties') try: ob = t(name, e_filepath, fullname=entry, properties=properties) except: import traceback typ, val, tb = exc_info() try: exc_lines = traceback.format_exception( typ, val, tb) LOG('DirectoryView', ERROR, join(exc_lines, '\n')) ob = BadFile(name, e_filepath, exc_str=join(exc_lines, '\r\n'), fullname=entry) finally: tb = None # Avoid leaking frame! ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) return data, tuple(objects)
def prepareContents(self, registry, register_subdirs=0): # Creates objects for each file. fp = expandpath(self.filepath) data = {} objects = [] types = self._readTypesFile() for entry in _filtered_listdir(fp): if not self._isAllowableFilename(entry): continue e_filepath = path.join(self.filepath, entry) e_fp = expandpath(e_filepath) if path.isdir(e_fp): # Add a subdirectory only if it was previously registered, # unless register_subdirs is set. info = registry.getDirectoryInfo(e_filepath) if info is None and register_subdirs: # Register unknown subdirs registry.registerDirectoryByPath(e_fp) info = registry.getDirectoryInfo(e_filepath) if info is not None: mt = types.get(entry) t = None if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = DirectoryView ob = t(entry, e_filepath) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) else: pos = rfind(entry, '.') if pos >= 0: name = entry[:pos] ext = path.normcase(entry[pos + 1:]) else: name = entry ext = '' if not name or name == 'REQUEST': # Not an allowable id. continue mo = bad_id(name) if mo is not None and mo != -1: # Both re and regex formats # Not an allowable id. continue t = None mt = types.get(entry, None) if mt is None: mt = types.get(name, None) if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = registry.getTypeByExtension(ext) if t is not None: metadata = FSMetadata(e_fp) metadata.read() try: ob = t(name, e_filepath, fullname=entry, properties=metadata.getProperties()) except: import traceback typ, val, tb = exc_info() try: exc_lines = traceback.format_exception( typ, val, tb) LOG('DirectoryView', ERROR, join(exc_lines, '\n')) ob = BadFile(name, e_filepath, exc_str=join(exc_lines, '\r\n'), fullname=entry) finally: tb = None # Avoid leaking frame! # FS-based security try: permissions = metadata.getSecurity() if permissions is not None: for name in permissions.keys(): acquire, roles = permissions[name] ob.manage_permission(name, roles, acquire) except: LOG('DirectoryView', ERROR, 'Error setting permissions', error=exc_info()) # only DTML Methods can have proxy roles if hasattr(ob, '_proxy_roles'): try: ob._proxy_roles = tuple(metadata.getProxyRoles()) except: LOG('DirectoryView', ERROR, 'Error setting proxy role', error=exc_info()) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) return data, tuple(objects)
def prepareContents(self, registry, register_subdirs=0): # Creates objects for each file. fp = expandpath(self.filepath) data = {} objects = [] l = listdir(fp) types = self._readTypesFile() for entry in l: if not self._isAllowableFilename(entry): continue e_filepath = path.join(self.filepath, entry) e_fp = expandpath(e_filepath) if path.isdir(e_fp): # Add a subdirectory only if it was previously registered, # unless register_subdirs is set. info = registry.getDirectoryInfo(e_filepath) if info is None and register_subdirs: # Register unknown subdirs if entry not in ('CVS', 'SVN', '.', '..'): registry.registerDirectoryByPath(e_fp) info = registry.getDirectoryInfo(e_filepath) if info is not None: mt = types.get(entry) t = None if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = DirectoryView ob = t(entry, e_filepath) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) else: pos = rfind(entry, '.') if pos >= 0: name = entry[:pos] ext = path.normcase(entry[pos + 1:]) else: name = entry ext = '' if not name or name == 'REQUEST': # Not an allowable id. continue mo = bad_id(name) if mo is not None and mo != -1: # Both re and regex formats # Not an allowable id. continue t = None mt = types.get(entry, None) if mt is None: mt = types.get(name, None) if mt is not None: t = registry.getTypeByMetaType(mt) if t is None: t = registry.getTypeByExtension(ext) if t is not None: try: ob = t(name, e_filepath, fullname=entry) except: from zLOG import LOG, ERROR import sys, traceback typ, val, tb = sys.exc_info() exc_lines = traceback.format_exception( typ, val, tb ) LOG( 'DirectoryView', ERROR, join( exc_lines, '\n' ) ) ob = BadFile( name , e_filepath , exc_str=join( exc_lines, '\r\n' ) , fullname=entry ) ob_id = ob.getId() data[ob_id] = ob objects.append({'id': ob_id, 'meta_type': ob.meta_type}) return data, tuple(objects)
def get_size(self): """Get the size of the underlying file.""" fp = expandpath(self._filepath) return path.getsize(fp)