コード例 #1
0
ファイル: objectfs.py プロジェクト: pombredanne/pyvfs
                                    mode=mode,
                                    **config)
            except:
                return

        return new

# 8<-----------------------------------------------------------------------
#
# create FS
fs = ObjectFS(vInode, root=True)
srv = Server(fs)
# do not start FS automatically if OBJECTFS_AUTOSTART is set to False
if os.environ.get("OBJECTFS_AUTOSTART", "True").lower() in (
        "yes", "true", "on", "t", "1"):
    srv.start()


class MetaExport(type):
    '''
    The metaclass exports objects to the virtual filesystem.
    To engage it, add to your class definition two attributes:

     * `__metaclass__ = MetaExport`
     * `__inode__ = {...}`

    `__inode__` dictionary can contain inode configuration:

     * `name`: string, default None
     * `is_file`: bool, default False
     * `blacklist`: list of strings
コード例 #2
0
ファイル: objectfs.py プロジェクト: pombredanne/pyvfs
                                    **config)
            except:
                return

        return new


# 8<-----------------------------------------------------------------------
#
# create FS
fs = ObjectFS(vInode, root=True)
srv = Server(fs)
# do not start FS automatically if OBJECTFS_AUTOSTART is set to False
if os.environ.get("OBJECTFS_AUTOSTART",
                  "True").lower() in ("yes", "true", "on", "t", "1"):
    srv.start()


class MetaExport(type):
    '''
    The metaclass exports objects to the virtual filesystem.
    To engage it, add to your class definition two attributes:

     * `__metaclass__ = MetaExport`
     * `__inode__ = {...}`

    `__inode__` dictionary can contain inode configuration:

     * `name`: string, default None
     * `is_file`: bool, default False
     * `blacklist`: list of strings