Ejemplo n.º 1
0
from pyvfs.vfs import Storage
from pyvfs.utils import Server

srv = Server(Storage())
# run the server in foreground
# to run in background, use start()
srv.run()
Ejemplo n.º 2
0
#!/usr/bin/env python

from pyvfs.utils import Server

#
# The protocol and options will be set up after
# environment variables, see documentation.
#
srv = Server()
#
# run server in the foreground
#
srv.run()
Ejemplo n.º 3
0
                new = parent.create(name,
                                    klass=klass,
                                    obj=obj,
                                    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:
Ejemplo n.º 4
0
                new = parent.create(name,
                                    klass=klass,
                                    obj=obj,
                                    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: