Skip to content

Commit 5fa827e

Browse files
committed
switched from fusepy to refuse
2 parents b722d2a + 8514070 commit 5fa827e

File tree

5 files changed

+14
-51
lines changed

5 files changed

+14
-51
lines changed

CHANGES.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Changes
44
0.0.5 (2019-XX-XX)
55
------------------
66

7-
* (TBD)
7+
* Switched from `fusepy`_ to `refuse`_
8+
9+
.. _fusepy: https://github.com/fusepy/fusepy
10+
.. _refuse: https://github.com/pleiszenburg/refuse
811

912
0.0.4 (2019-05-01)
1013
------------------

README.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,9 @@ CAVEATS
5757
=======
5858

5959
* PROJECT STATUS: **BETA**
60-
* A `CUSTOM BUG-FIXED VERSION OF FUSEPY`_ IS REQUIRED FOR FULL POSIX COMPLIANCE.
61-
IT IS AUTOMATICALLY INSTALLED FROM GITHUB AS A DEPENDENCY OF THIS PACKAGE.
62-
IF THE LATEST OFFICIAL RELEASE OF FUSEPY IS USED INSTEAD, TIMESTAMPS WILL BE
63-
INACCURATE ON A NANOSECOND TO MICROSECOND SCALE AND UTIME_NOW AS WELL AS
64-
UTIME_OMIT WILL NOT BE HONORED. THERE WAS A `PULL REQUEST`_ TO FIX THIS,
65-
WHICH HAS BEEN REJECTED. ALTERNATIVE APPROACHES ARE BEING RESEARCHED.
6660
* THE FILESYSTEM IS CURRENTLY **ONLY** BEING DEVELOPED FOR AND TESTED ON **LINUX**.
6761
ANYONE INTERESTED IN CONFIRMING MAC OS X AND/OR ADDING BSD SUPPORT?
6862

69-
.. _CUSTOM BUG-FIXED VERSION OF FUSEPY: https://github.com/s-m-e/fusepy
70-
.. _PULL REQUEST: https://github.com/fusepy/fusepy/pull/79
71-
7263

7364
Installation
7465
============

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
include_package_data = True,
101101
install_requires = [
102102
'click>=7.0',
103-
'fusepy @ git+https://github.com/s-m-e/fusepy@master#egg=fusepy-2.0.99',
103+
'refuse==0.0.2',
104104
'xmltodict'
105105
],
106106
extras_require = {'dev': development_deps_list},

src/loggedfs/_core/fs.py

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,12 @@
3333
import os
3434
import stat
3535

36-
from fuse import (
36+
from refuse.high import (
3737
FUSE,
3838
fuse_get_context,
3939
FuseOSError,
40-
Operations,
41-
UTIME_NOW,
42-
UTIME_OMIT,
40+
Operations
4341
)
44-
try:
45-
from fuse import __features__ as fuse_features
46-
except ImportError:
47-
fuse_features = {}
4842

4943
from .defaults import (
5044
FUSE_ALLOWOTHER_DEFAULT,
@@ -109,13 +103,7 @@ class _loggedfs(Operations):
109103

110104

111105
flag_utime_omit_ok = 1
112-
113-
114-
requested_features = {
115-
'nanosecond_int': True,
116-
'utime_omit_none': True,
117-
'utime_now_auto': True
118-
}
106+
use_ns = True
119107

120108

121109
_ST_FIELDS = tuple(i for i in dir(os.stat_result) if i.startswith('st_'))
@@ -210,13 +198,6 @@ def __init__(self,
210198
'LoggedFS-python using configuration file %s' % log_configfile
211199
))
212200

213-
for flag_name in self.requested_features.keys():
214-
setattr(
215-
self,
216-
'flag_' + flag_name,
217-
self.requested_features[flag_name] and fuse_features.get(flag_name, False)
218-
)
219-
220201
if len(kwargs) > 0:
221202
raise ValueError('unknown keyword argument(s)')
222203

@@ -317,10 +298,7 @@ def getattr(self, path, fip):
317298
ret_dict = {key: getattr(st, key) for key in self._ST_FIELDS}
318299

319300
for key in ['st_atime', 'st_ctime', 'st_mtime']:
320-
if self.flag_nanosecond_int:
321-
ret_dict[key] = ret_dict.pop(key + '_ns')
322-
else:
323-
ret_dict.pop(key + '_ns')
301+
ret_dict[key] = ret_dict.pop(key + '_ns')
324302

325303
return ret_dict
326304

@@ -488,26 +466,17 @@ def unlink(self, path):
488466
def utimens(self, path, times = None):
489467

490468
def _fix_time_(atime, mtime):
491-
if any(val in (atime, mtime) for val in [UTIME_OMIT, None]):
469+
if None in (atime, mtime):
492470
st = os.lstat(relpath, dir_fd = self._root_path_fd)
493-
if atime in [UTIME_OMIT, None]:
471+
if atime is None:
494472
atime = st.st_atime_ns
495-
if mtime in [UTIME_OMIT, None]:
473+
if mtime is None:
496474
mtime = st.st_mtime_ns
497-
if UTIME_NOW in (atime, mtime):
498-
now = time.time_ns()
499-
if atime == UTIME_NOW:
500-
atime = now
501-
if mtime == UTIME_NOW:
502-
mtime = now
503475
return (atime, mtime)
504476

505477
relpath = self._rel_path(path)
506478

507-
if self.flag_nanosecond_int:
508-
os.utime(relpath, ns = _fix_time_(*times), dir_fd = self._root_path_fd, follow_symlinks = False)
509-
else:
510-
os.utime(relpath, times = times, dir_fd = self._root_path_fd, follow_symlinks = False)
479+
os.utime(relpath, ns = _fix_time_(*times), dir_fd = self._root_path_fd, follow_symlinks = False)
511480

512481

513482
@event(format_pattern = '{param_buf_len} bytes to {param_path} at offset {param_offset} (fh={param_fip})')

src/loggedfs/_core/out.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import pwd
3939
import zlib
4040

41-
from fuse import (
41+
from refuse.high import (
4242
fuse_get_context,
4343
FuseOSError,
4444
)

0 commit comments

Comments
 (0)