Skip to content

added Files Locking support #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2024
Merged

added Files Locking support #227

merged 3 commits into from
Feb 15, 2024

Conversation

bigcat88
Copy link
Member

Implemented using WebDAV requests.

    async def lock(self, path: FsNode | str, lock_type: LockType = LockType.MANUAL_LOCK) -> None:
        """Locks the file.

        .. note:: Exception codes: 423 - existing lock present.
        """
        pass
        
    async def unlock(self, path: FsNode | str) -> None:
        """Unlocks the file.

        .. note:: Exception codes: 412 - the file is not locked, 423 - the lock is owned by another user.
        """ 
        pass   

Reference: https://github.com/nextcloud/files_lock

Signed-off-by: Alexander Piskun <[email protected]>
Signed-off-by: Alexander Piskun <[email protected]>
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (10417cf) 99.83% compared to head (df9fa6a) 99.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #227   +/-   ##
=======================================
  Coverage   99.83%   99.84%           
=======================================
  Files          42       42           
  Lines        4943     5010   +67     
=======================================
+ Hits         4935     5002   +67     
  Misses          8        8           
Files Coverage Δ
nc_py_api/__init__.py 100.00% <100.00%> (ø)
nc_py_api/_version.py 100.00% <100.00%> (ø)
nc_py_api/files/__init__.py 99.65% <100.00%> (+0.05%) ⬆️
nc_py_api/files/_files.py 98.52% <100.00%> (+0.06%) ⬆️
nc_py_api/files/files.py 100.00% <100.00%> (ø)

Signed-off-by: Alexander Piskun <[email protected]>
@bigcat88 bigcat88 merged commit 33d8973 into main Feb 15, 2024
@bigcat88 bigcat88 deleted the files-locking branch February 15, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant