Skip to content

Commit

Permalink
0.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed May 6, 2019
2 parents f74a674 + 63c9b1d commit d92e50b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 51 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changes
=======

0.0.5 (2019-05-06)
------------------

* Switched from `fusepy`_ to `refuse`_

.. _fusepy: https://github.com/fusepy/fusepy
.. _refuse: https://github.com/pleiszenburg/refuse

0.0.4 (2019-05-01)
------------------

Expand Down
9 changes: 0 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,9 @@ CAVEATS
=======

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

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


Installation
============
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


# Bump version HERE!
_version_ = '0.0.4'
_version_ = '0.0.5'


# List all versions of Python which are supported
Expand Down Expand Up @@ -100,7 +100,7 @@
include_package_data = True,
install_requires = [
'click>=7.0',
'fusepy @ git+https://github.com/s-m-e/fusepy@master#egg=fusepy-2.0.99',
'refuse==0.0.2',
'xmltodict'
],
extras_require = {'dev': development_deps_list},
Expand Down
47 changes: 8 additions & 39 deletions src/loggedfs/_core/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@
import os
import stat

from fuse import (
from refuse.high import (
FUSE,
fuse_get_context,
FuseOSError,
Operations,
UTIME_NOW,
UTIME_OMIT,
Operations
)
try:
from fuse import __features__ as fuse_features
except ImportError:
fuse_features = {}

from .defaults import (
FUSE_ALLOWOTHER_DEFAULT,
Expand Down Expand Up @@ -109,13 +103,7 @@ class _loggedfs(Operations):


flag_utime_omit_ok = 1


requested_features = {
'nanosecond_int': True,
'utime_omit_none': True,
'utime_now_auto': True
}
use_ns = True


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

for flag_name in self.requested_features.keys():
setattr(
self,
'flag_' + flag_name,
self.requested_features[flag_name] and fuse_features.get(flag_name, False)
)

if len(kwargs) > 0:
raise ValueError('unknown keyword argument(s)')

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

for key in ['st_atime', 'st_ctime', 'st_mtime']:
if self.flag_nanosecond_int:
ret_dict[key] = ret_dict.pop(key + '_ns')
else:
ret_dict.pop(key + '_ns')
ret_dict[key] = ret_dict.pop(key + '_ns')

return ret_dict

Expand Down Expand Up @@ -488,26 +466,17 @@ def unlink(self, path):
def utimens(self, path, times = None):

def _fix_time_(atime, mtime):
if any(val in (atime, mtime) for val in [UTIME_OMIT, None]):
if None in (atime, mtime):
st = os.lstat(relpath, dir_fd = self._root_path_fd)
if atime in [UTIME_OMIT, None]:
if atime is None:
atime = st.st_atime_ns
if mtime in [UTIME_OMIT, None]:
if mtime is None:
mtime = st.st_mtime_ns
if UTIME_NOW in (atime, mtime):
now = time.time_ns()
if atime == UTIME_NOW:
atime = now
if mtime == UTIME_NOW:
mtime = now
return (atime, mtime)

relpath = self._rel_path(path)

if self.flag_nanosecond_int:
os.utime(relpath, ns = _fix_time_(*times), dir_fd = self._root_path_fd, follow_symlinks = False)
else:
os.utime(relpath, times = times, dir_fd = self._root_path_fd, follow_symlinks = False)
os.utime(relpath, ns = _fix_time_(*times), dir_fd = self._root_path_fd, follow_symlinks = False)


@event(format_pattern = '{param_buf_len} bytes to {param_path} at offset {param_offset} (fh={param_fip})')
Expand Down
2 changes: 1 addition & 1 deletion src/loggedfs/_core/out.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import pwd
import zlib

from fuse import (
from refuse.high import (
fuse_get_context,
FuseOSError,
)
Expand Down

0 comments on commit d92e50b

Please sign in to comment.