Skip to content

Commit 447091d

Browse files
author
dzsekijo
committed
defining fuse_python_api made mandatory
1 parent 00b6da9 commit 447091d

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

example/hello.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
raise RuntimeError, \
2121
"your fuse-py doesn't know of fuse.__version__, probably it's too old."
2222

23-
# This setting is optional, but it ensures that this class will keep
24-
# working after a future API revision
2523
fuse.fuse_python_api = (0, 2)
2624

2725
hello_path = '/hello'

example/xmp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
raise RuntimeError, \
2525
"your fuse-py doesn't know of fuse.__version__, probably it's too old."
2626

27-
# This setting is optional, but it ensures that this class will keep
28-
# working after a future API revision
2927
fuse.fuse_python_api = (0, 2)
3028

3129
fuse.feature_assert('stateful_files', 'has_init')

fuse.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,24 @@ def __init__(self, *args, **kw):
633633
available options.)
634634
"""
635635

636+
if not fuse_python_api and not compat_0_1:
637+
raise RuntimeError, __name__ + """.fuse_python_api not defined.
638+
639+
! Please define """ + __name__ + """.fuse_python_api internally (eg.
640+
!
641+
! (1) """ + __name__ + """.fuse_python_api = """ + `FUSE_PYTHON_API_VERSION` + """
642+
!
643+
! ) or in the enviroment (eg.
644+
!
645+
! (2) FUSE_PYTHON_API=0.1
646+
!
647+
! ).
648+
!
649+
! If you are actually developing a filesystem, probably (1) is the way to go.
650+
! If you are using a filesystem written before 2007 Q2, probably (2) is what
651+
! you want."
652+
"""
653+
636654
self.fuse_args = \
637655
'fuse_args' in kw and kw.pop('fuse_args') or FuseArgs()
638656

0 commit comments

Comments
 (0)