announce version of the current API by means of FUSE_PYTHON_API_VERSION constant
This commit is contained in:
parent
4ca78fbdad
commit
caffe5fd92
2 changed files with 8 additions and 5 deletions
|
|
@ -313,7 +313,8 @@ safely passed down to FUSE.
|
|||
Long-term compatibility
|
||||
-----------------------
|
||||
|
||||
You are suggested to declare explicitly that you use the current API by setting
|
||||
``fuse.fuse_python_api = (0, 2)``. This ensures that your code will keep
|
||||
working even if further API revisions take place. (At the moment this setting
|
||||
will make no difference.)
|
||||
You are suggested to declare explicitly the API you use by setting
|
||||
``fuse.fuse_python_api`` to the value of ``fuse.FUSE_PYTHON_API_VERSION`` as
|
||||
it's definied in the fuse.py instance you code your filesystem against. This
|
||||
ensures that your code will keep working even if further API revisions take
|
||||
place.
|
||||
|
|
|
|||
4
fuse.py
4
fuse.py
|
|
@ -37,7 +37,8 @@ from fuseparts.setcompatwrap import set
|
|||
###
|
||||
##########
|
||||
|
||||
|
||||
# The actual API version of this module
|
||||
FUSE_PYTHON_API_VERSION = (0, 2)
|
||||
|
||||
def __getenv__(var, pattern = '.', trans = lambda x: x):
|
||||
"""
|
||||
|
|
@ -67,6 +68,7 @@ def get_fuse_python_api():
|
|||
def get_compat_0_1():
|
||||
return get_fuse_python_api() == (0, 1)
|
||||
|
||||
# API version to be used
|
||||
fuse_python_api = __getenv__('FUSE_PYTHON_API', '^[\d.]+$',
|
||||
lambda x: tuple([int(i) for i in x.split('.')]))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue