Skip to content

Commit 0e66f31

Browse files
committed
reformat /docstrings - ruff
1 parent 5a1a4bc commit 0e66f31

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

irods/access.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ def copy(self, decanonicalize=False, implied_zone=''):
126126
Create a copy of the object, possibly in a normalized form.
127127
128128
Args:
129-
decanonicalize: Whether to modify to access_name field to a more human-readable (1/True) or more standard (-1) form.
130-
If the former, then a more organic style is favored, i.e. "read" and "write". If the latter, the new access_name
131-
will be more machine-friendly for operators __lt__ (for sorting) and __eq__ (for equivalence or use with 'in').
132-
implied_zone: If a nonzero-length name, compare this against the zone_name field of the old object, and if they match,
133-
force the zone_name to zero-length in the new object.
129+
decanonicalize: Whether to modify to access_name field to a more human-readable (1/True)
130+
or more standard (-1) form. If the former, then a more organic style is favored, i.e.
131+
"read" and "write". If the latter, the new access_name will be more machine-friendly
132+
for operators __lt__ (for sorting) and __eq__ (for equivalence or use with 'in').
133+
implied_zone: If a nonzero-length name, compare this against the zone_name field of the
134+
old object, and if they match, force the zone_name to zero-length in the new object.
134135
135136
Returns:
136137
A copy of the invoking object, normalized if requested.
@@ -159,11 +160,12 @@ def copy(self, decanonicalize=False, implied_zone=''):
159160
pass
160161
else:
161162
msg = "Improper value for 'decanonicalize' parameter"
162-
raise RuntimerError(msg)
163+
raise RuntimeError(msg)
163164

164165
other.access_name = access_name
165166

166-
# Useful if we wish to force an explicitly specified local zone to an implicit zone spec in the copy, for equality testing:
167+
# Useful if we wish to force an explicitly specified local zone to an implicit zone spec in the copy, for
168+
# equality testing:
167169
if '' != implied_zone == other.user_zone:
168170
other.user_zone = ''
169171

@@ -177,13 +179,25 @@ def __repr__(self):
177179

178180

179181
class iRODSAccess(_iRODSAccess_base, metaclass=_Access_LookupMeta):
182+
"""
183+
This class represents an ACL in iRODS and functions as a data container
184+
to convey information to the iRODS server (in the `set` call) and back again to the client
185+
again (in the `get` call.)
186+
"""
180187
def __init__(self, access_name, path, user_name="", user_zone="", user_type=None):
181188
self.codes = self.__class__.codes
182189
self.strings = self.__class__.strings
183190
super().__init__(access_name, path, user_name, user_zone, user_type)
184191

185192

186193
class ACLOperation(iRODSAccess):
194+
"""
195+
Similar to its base class iRODSAccess, this class represents an ACL to be set on an object.
196+
but this class is the counterpart used for the atomic ACLs api. It differs from its base
197+
class in that it has no field to store a logical object path. (For an atomic API call, i
198+
here is always a single logical path to which all operations apply, meaning that it is
199+
appropriate to conveyed that in a location separate from the operations themsevles.)
200+
"""
187201
def __init__(self, access_name: str, user_name: str = "", user_zone: str = ""):
188202
super().__init__(
189203
access_name=access_name,
@@ -251,7 +265,7 @@ def __init__(self, *args, **kwargs):
251265
)
252266
super().__init__(*args,**kwargs)
253267

254-
_deprecated_names = {'_iRODSAccess_pre_4_3_0':_deprecated._iRODSAccess_pre_4_3_0}
268+
_deprecated_names = {'_iRODSAccess_pre_4_3_0': _deprecated._iRODSAccess_pre_4_3_0}
255269

256270
def __getattr__(name):
257271
if name in _deprecated_names:

0 commit comments

Comments
 (0)