Beispiel #1
0
    def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
        from fs.osfs import OSFS

        path = os.path.normpath(fs_path)
        if create_dir and not os.path.exists(path):
            from fs.osfs import _os_makedirs
            _os_makedirs(path)
        dirname, resourcename = os.path.split(fs_path)
        osfs = OSFS(dirname)
        return osfs, resourcename
Beispiel #2
0
 def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable, create_dir):
     from fs.osfs import OSFS 
                                         
     path = os.path.normpath(fs_path)
     if create_dir and not os.path.exists(path):
         from fs.osfs import _os_makedirs                    
         _os_makedirs(path)            
     dirname, resourcename = os.path.split(fs_path)
     osfs = OSFS(dirname)
     return osfs, resourcename