Skip to content
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

Feature/binprotocol #92

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2929669
Implement more methods and fix security hotspot
tomgross Jun 24, 2023
ceb9ff5
readd
tomgross Jun 24, 2023
0c9f4e3
Added more test methods and update test deps
tomgross Dec 22, 2023
503e49e
Choose compatible plyawright version
tomgross Dec 22, 2023
74bd97c
foo
tomgross Dec 22, 2023
a2eb6f1
fix-oauth2-bug
masrlinu Aug 1, 2023
75c7272
Fix Playwright locators in test
tomgross Dec 22, 2023
204cf46
PyFS
tomgross Dec 26, 2023
e9937a2
foo
tomgross Jan 5, 2024
0f986d1
foo
tomgross Jan 5, 2024
538a784
20 failures
tomgross Jan 5, 2024
1cd926e
2 failures
tomgross Jan 6, 2024
298e8b0
1 failure
tomgross Jan 6, 2024
8dc881d
black
tomgross Jan 6, 2024
b01fb15
foo
tomgross Jan 20, 2024
b5afe46
use other implementation
tomgross Feb 5, 2024
a3ac07b
Simplify code
tomgross Feb 9, 2024
ada2543
All tests pass
tomgross Feb 9, 2024
9907272
Error handling
tomgross Feb 10, 2024
54ae08e
Error handling
tomgross Feb 11, 2024
75ab098
More Error handling
tomgross Feb 11, 2024
6c168fe
Lock on getinfo
tomgross Feb 11, 2024
60bb12d
Don't stream session
tomgross Feb 11, 2024
4854018
Try to stablize pyfs tests
tomgross Feb 11, 2024
821e1bf
add binary protocol
tomgross Feb 28, 2024
d8fcb73
PyFS
tomgross Mar 1, 2024
cd8945f
Update setuptools requirement
tomgross Jul 17, 2024
86e68aa
Fix import error
tomgross Jul 17, 2024
b988535
Files from master
tomgross Dec 29, 2024
ae69dcf
rename
tomgross Dec 29, 2024
ac0f2a6
foo
tomgross Dec 29, 2024
7306e2f
foo
tomgross Dec 29, 2024
7c1c82d
Merge branch 'master' into feature/binprotocol
tomgross Dec 29, 2024
f51fbc9
Merge branch 'master' into feature/binprotocol
tomgross Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Error handling
tomgross committed Feb 11, 2024
commit 54ae08e34dd883d9d3ee22ffbced3b747d5ec7fc
22 changes: 14 additions & 8 deletions src/pcloud/pcloudfs.py
Original file line number Diff line number Diff line change
@@ -327,24 +327,28 @@ def on_close(pcloudfile):
data = self.pcloud.file_read(fd=fd, count=info.size)
pcloud_file.seek(0, os.SEEK_END)
pcloud_file.raw.write(data)
self.pcloud.file_close(fd=fd)
resp = self.pcloud.file_close(fd=fd)
if resp.get('result') != 0:
api.log.error(f'Error closing file {_path} failed with {resp}')
else:
api.log.error(f'No open file found to write. {resp}')

return pcloud_file

info = self.getinfo(_path, namespaces=["details"])
if info.is_dir:
raise errors.FileExpected(path)
raise errors.FileExpected(_path)

pcloud_file = PCloudFile.factory(path, _mode, on_close=on_close)
pcloud_file = PCloudFile.factory(_path, _mode, on_close=on_close)
resp = self.pcloud.file_open(path=_path, flags=api.O_WRITE)
fd = resp.get("fd")
if fd is not None:
pcloud_file.raw.write(self.pcloud.file_read(fd=fd, count=info.size))
self.pcloud.file_close(fd=fd)
if fd is None:
api.log.error(f'Error opening file {_path} failed with {resp}')
else:
api.log.error(f'No open file found to write. {resp}')
pcloud_file.raw.write(self.pcloud.file_read(fd=fd, count=info.size))
resp = self.pcloud.file_close(fd=fd)
if resp.get('result') != 0:
api.log.error(f'Error closing file {_path} failed with {resp}')

pcloud_file.seek(0)
return pcloud_file
@@ -356,7 +360,9 @@ def remove(self, path):
if self.getinfo(_path).is_dir == True:
raise errors.FileExpected(_path)
with self._lock:
self.pcloud.deletefile(path=_path)
resp = self.pcloud.deletefile(path=_path)
if resp["result"] != 0:
api.log.error(f"Removing of file {_path} failed {resp}")

def removedir(self, path):
_path = self.validatepath(path)