Skip to content

Commit 9a0bcb8

Browse files
committed
update to pass pylint
1 parent d4585fa commit 9a0bcb8

6 files changed

Lines changed: 13 additions & 15 deletions

File tree

cterasdk/cli/dav.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def handle_ls(args):
4444
print(formatter.format(*row))
4545

4646

47-
async def handle_download(args):
47+
async def handle_download(args): # pylint: disable=too-many-branches
4848
target = Path(args.dest or os.getcwd())
4949

5050
try:
@@ -59,11 +59,11 @@ async def download(invitation, resource, objects=None, archive=False, destinatio
5959
async with AsyncInvitation.from_uri(args.endpoint) as invitation:
6060
jobs = []
6161

62-
if not invitation.details.is_dir:
62+
if not invitation.details.is_dir: # pylint: disable=too-many-nested-blocks
6363
if args.src:
6464
print(f"error: object not found error: '{args.src}'", file=sys.stderr)
6565
sys.exit(1)
66-
resource = await anext(invitation.files.listdir()) # noqa: F821
66+
resource = await invitation.files.listdir().__anext__()
6767
jobs.append(download(invitation, resource, destination=target))
6868
else:
6969
try:
@@ -90,9 +90,9 @@ async def download(invitation, resource, objects=None, archive=False, destinatio
9090
except PermissionError:
9191
print(f"error: permission denied: Cannot create files and folders at '{target}'.", file=sys.stderr)
9292
except NotADirectoryError:
93-
print(f"error: path conflict: '{target}' is a file, but a folder was expected.", file=sys.strerr)
93+
print(f"error: path conflict: '{target}' is a file, but a folder was expected.", file=sys.stderr)
9494
except OSError as e:
95-
print(f"error: an unexpected error occurred during download. {e}", file=sys.strerr)
95+
print(f"error: an unexpected error occurred during download. {e}", file=sys.stderr)
9696

9797

9898
async def handle_upload(args):

cterasdk/core/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ def rename(apply_all=True):
894894
class PortalInvitation(Object):
895895

896896
def __init__(self, access, is_dir):
897+
super().__init__()
897898
self.access = access
898899
self.is_dir = is_dir
899900

cterasdk/lib/session/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class BaseUser(Object):
2121
"""Base User Account"""
2222

2323
def __init__(self, type_of):
24+
super().__init__()
2425
self.type = type_of
2526

2627

cterasdk/objects/asynchronous/invitation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def context(self):
3131
def _authenticator(self, url): # pylint: disable=unused-argument
3232
return True
3333

34-
async def login(self):
34+
async def login(self): # pylint: disable=arguments-differ
3535
await super().login('share', self.invite)
3636
self.details = await self.files.details()
3737

3838
@property
3939
def uri(self):
40-
return invitation.uri(self)
40+
return f'{self.clients.v1.ctera.baseurl}/?share={self.invite}'
4141

4242
@property
4343
def _login_object(self):

cterasdk/objects/invitation.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from .uri import components, parse_qsl
22

33

4-
def validate(uri):
5-
r = components(uri)
4+
def validate(resource):
5+
r = components(resource)
66

77
assert r.scheme == "https", f"Error: Expected 'https' scheme, got '{r.scheme}'."
88
assert r.netloc, "Error: Could not identify network location."
@@ -19,7 +19,3 @@ def validate(uri):
1919
return r.hostname, r.port, invite
2020

2121
raise ValueError("Error: Could not find invitation identifer.")
22-
23-
24-
def uri(invitation):
25-
return f'{invitation.clients.ctera.baseurl}/?share={invitation.invite}'

cterasdk/objects/synchronous/invitation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def context(self):
3131
def _authenticator(self, url): # pylint: disable=unused-argument
3232
return True
3333

34-
def login(self):
34+
def login(self): # pylint: disable=arguments-differ
3535
super().login('share', self.invite)
3636
self.details = self.files.details()
3737

3838
@property
3939
def uri(self):
40-
return invitation.uri(self)
40+
return f'{self.clients.ctera.baseurl}/?share={self.invite}'
4141

4242
@property
4343
def _login_object(self):

0 commit comments

Comments
 (0)