Simplest exampleΒΆ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""
Simplest PyVFS example
"""

# start PyVFS thread and import the decorator
from pyvfs.objectfs import export

# Python3 support
import sys
if sys.version_info[0] > 2:
    def raw_input(s):
        return input(s)


# export all objects of the Example class
@export
class Example(object):

    def __init__(self, text):
        self.text = text

# spawn several objects
objects_A = [Example(x) for x in range(1000)]

# now you can mount your script with the command
# mount -t 9p -o ro,port=10001 127.0.0.1 /mnt

# wait for input
# W: do not forget to umount! :)
raw_input("press enter to exit >")