Skip to content

Commit 7dcc7a6

Browse files
committed
Changes to use docformatter
1 parent cd49038 commit 7dcc7a6

File tree

6 files changed

+166
-35
lines changed

6 files changed

+166
-35
lines changed

dfvfs/helpers/source_scanner.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ def __init__(self, path_spec):
5555

5656
@property
5757
def type_indicator(self):
58-
"""str: path specification type indicator."""
58+
"""Retrieves the type indicator.
59+
60+
Returns:
61+
str: path specification type indicator.
62+
"""
5963
return self.path_spec.type_indicator
6064

6165
def GetSubNodeByLocation(self, location):
@@ -165,7 +169,11 @@ def __init__(self):
165169

166170
@property
167171
def locked_scan_nodes(self):
168-
"""List[SourceScanNode]: locked scan nodes."""
172+
"""Retrieves the locked scan nodes.
173+
174+
Returns:
175+
list[SourceScanNode]: locked scan nodes.
176+
"""
169177
return list(self._locked_scan_nodes.values())
170178

171179
def AddScanNode(self, path_spec, parent_scan_node):

dfvfs/lib/gzipfile.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,11 @@ def __init__(self):
427427

428428
@property
429429
def members(self):
430-
"""List(GzipMember): members in the gzip file."""
430+
"""Retrieves the members in the file.
431+
432+
Returns:
433+
list[GzipMember]: members in the file.
434+
"""
431435
return list(self._members_by_end_offset.values())
432436

433437
def _GetMemberForOffset(self, offset):

dfvfs/vfs/apfs_container_file_entry.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ def _GetSubFileEntries(self):
8080

8181
@property
8282
def name(self):
83-
"""str: name of the file entry, which does not include the full path."""
83+
"""Retrieves the name.
84+
85+
Return:
86+
str: name of the file entry, which does not include the full path.
87+
"""
8488
if self._name is None:
8589
self._name = ''
8690

@@ -98,7 +102,11 @@ def name(self):
98102

99103
@property
100104
def size(self):
101-
"""int: size of the file entry in bytes or None if not available."""
105+
"""Retrieves the size.
106+
107+
Returns:
108+
int: size of the file entry in bytes or None if not available.
109+
"""
102110
if self._fsapfs_volume is None:
103111
return None
104112

@@ -107,7 +115,11 @@ def size(self):
107115

108116
@property
109117
def sub_file_entries(self):
110-
"""Generator[APFSContainerFileEntry]: sub file entries."""
118+
"""Retrieves sub file entries.
119+
120+
Returns:
121+
generator[APFSContainerFileEntry]: sub file entries.
122+
"""
111123
return self._GetSubFileEntries()
112124

113125
def GetAPFSVolume(self):

dfvfs/vfs/directory.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,9 @@ def _EntriesGenerator(self):
3434

3535
@property
3636
def entries(self):
37-
"""Generator[PathSpec]: path specifications of the directory entries."""
37+
"""Retrieves directory entries.
38+
39+
Returns:
40+
generator[PathSpec]: path specifications of the directory entries.
41+
"""
3842
return self._EntriesGenerator()

dfvfs/vfs/file_entry.py

+86-19
Original file line numberDiff line numberDiff line change
@@ -122,77 +122,133 @@ def _GetSubFileEntries(self):
122122

123123
@property
124124
def access_time(self):
125-
"""dfdatetime.DateTimeValues: access time or None if not available."""
125+
"""Retrieves the access time.
126+
127+
Returns:
128+
dfdatetime.DateTimeValues: access time or None if not available.
129+
"""
126130
return None
127131

128132
@property
129133
def added_time(self):
130-
"""dfdatetime.DateTimeValues: added time or None if not available."""
134+
"""Retrieves the added time.
135+
136+
Returns:
137+
dfdatetime.DateTimeValues: added time or None if not available.
138+
"""
131139
return None
132140

133141
@property
134142
def attributes(self):
135-
"""Generator[Attribute]: attributes."""
143+
"""Retrieves attributes.
144+
145+
Returns:
146+
generator[Attribute]: attributes.
147+
"""
136148
return self._GetAttributes()
137149

138150
@property
139151
def backup_time(self):
140-
"""dfdatetime.DateTimeValues: backup time or None if not available."""
152+
"""Retrieves the backup time.
153+
154+
Returns:
155+
dfdatetime.DateTimeValues: backup time or None if not available.
156+
"""
141157
return None
142158

143159
@property
144160
def change_time(self):
145-
"""dfdatetime.DateTimeValues: change time or None if not available."""
161+
"""Retrieves the change time.
162+
163+
Returns:
164+
dfdatetime.DateTimeValues: change time or None if not available.
165+
"""
146166
return None
147167

148168
@property
149169
def creation_time(self):
150-
"""dfdatetime.DateTimeValues: creation time or None if not available."""
170+
"""Retrieves the creation time.
171+
172+
Returns:
173+
dfdatetime.DateTimeValues: creation time or None if not available.
174+
"""
151175
return None
152176

153177
@property
154178
def deletion_time(self):
155-
"""dfdatetime.DateTimeValues: deletion time or None if not available."""
179+
"""Retrieves the deletion time.
180+
181+
Returns:
182+
dfdatetime.DateTimeValues: deletion time or None if not available.
183+
"""
156184
return None
157185

158186
@property
159187
def data_streams(self):
160-
"""Generator[DataStream]: data streams."""
188+
"""Retrieves data streams.
189+
190+
Returns:
191+
generator[DataStream]: data streams.
192+
"""
161193
return self._GetDataStreams()
162194

163195
@property
164196
def link(self):
165-
"""str: full path of the linked file entry or None if not available."""
197+
"""Retrieves the path of a linked file entry.
198+
199+
Returns:
200+
str: full path of the linked file entry or None if not available.
201+
"""
166202
if not self.IsLink():
167203
return None
168204

169205
return self._GetLink()
170206

171207
@property
172208
def modification_time(self):
173-
"""dfdatetime.DateTimeValues: modification time or None if not available."""
209+
"""Retrieves the modification time.
210+
211+
Returns:
212+
dfdatetime.DateTimeValues: modification time or None if not available.
213+
"""
174214
return None
175215

176216
@property
177217
@abc.abstractmethod
178218
def name(self):
179-
"""str: name of the file entry, without the full path."""
219+
"""Retrieves the name.
220+
221+
Returns:
222+
str: name of the file entry, without the full path.
223+
"""
180224

181225
@property
182226
def number_of_attributes(self):
183-
"""int: number of attributes."""
227+
"""Retrieves the number of attributes.
228+
229+
Returns:
230+
int: number of attributes.
231+
"""
184232
attributes = self._GetAttributes()
185233
return len(attributes)
186234

187235
@property
188236
def number_of_data_streams(self):
189-
"""int: number of data streams."""
237+
"""Retrieves the number of data streams.
238+
239+
Returns:
240+
int: number of data streams.
241+
"""
190242
data_streams = self._GetDataStreams()
191243
return len(data_streams)
192244

193245
@property
194246
def number_of_sub_file_entries(self):
195-
"""int: number of sub file entries."""
247+
"""Retrieves the number of sub file entries.
248+
249+
Returns:
250+
int: number of sub file entries.
251+
"""
196252
number_of_sub_file_entries = 0
197253
if self.entry_type == definitions.FILE_ENTRY_TYPE_DIRECTORY:
198254
directory = self._GetDirectory()
@@ -203,19 +259,30 @@ def number_of_sub_file_entries(self):
203259

204260
@property
205261
def size(self):
206-
"""int: size of the file entry in bytes or None if not available."""
262+
"""Retrieves the size.
263+
264+
Returns:
265+
int: size of the file entry in bytes or None if not available.
266+
"""
207267
return None
208268

209269
@property
210270
def sub_file_entries(self):
211-
"""Generator[FileEntry]: sub file entries."""
271+
"""Retrieves sub file entries.
272+
273+
Returns:
274+
generator[FileEntry]: sub file entries.
275+
"""
212276
return self._GetSubFileEntries()
213277

214278
@property
215279
def type_indicator(self):
216-
"""str: type indicator."""
217-
# pylint: disable=no-member
218-
return self.TYPE_INDICATOR
280+
"""Retrieves the type indicator.
281+
282+
Returns:
283+
str: type indicator.
284+
"""
285+
return getattr(self, 'TYPE_INDICATOR', None)
219286

220287
def GetDataStream(self, name, case_sensitive=True):
221288
"""Retrieves a data stream by name.

dfvfs/volume/volume_system.py

+45-9
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ def _Parse(self):
8080

8181
@property
8282
def attributes(self):
83-
"""Generator[VolumeAttribute]: volume attributes generator."""
83+
"""Retrieves attributes.
84+
85+
Returns:
86+
generator[VolumeAttribute]: volume attributes generator.
87+
"""
8488
if not self._is_parsed:
8589
self._Parse()
8690
self._is_parsed = True
@@ -89,7 +93,11 @@ def attributes(self):
8993

9094
@property
9195
def extents(self):
92-
"""List[VolumeExtent]: volume extents."""
96+
"""Retrieves extents.
97+
98+
Returns:
99+
list[VolumeExtent]: volume extents.
100+
"""
93101
if not self._is_parsed:
94102
self._Parse()
95103
self._is_parsed = True
@@ -98,7 +106,11 @@ def extents(self):
98106

99107
@property
100108
def number_of_attributes(self):
101-
"""int: number of attributes."""
109+
"""Retrieves the number of attributes.
110+
111+
Returns:
112+
int: number of attributes.
113+
"""
102114
if not self._is_parsed:
103115
self._Parse()
104116
self._is_parsed = True
@@ -107,7 +119,11 @@ def number_of_attributes(self):
107119

108120
@property
109121
def number_of_extents(self):
110-
"""int: number of extents."""
122+
"""Retrieves the number of extents.
123+
124+
Returns:
125+
int: number of extents.
126+
"""
111127
if not self._is_parsed:
112128
self._Parse()
113129
self._is_parsed = True
@@ -181,7 +197,11 @@ def _Parse(self):
181197

182198
@property
183199
def number_of_sections(self):
184-
"""int: number of sections."""
200+
"""Retrieves the number of sections.
201+
202+
Returns:
203+
int: number of sections.
204+
"""
185205
if not self._is_parsed:
186206
self._Parse()
187207
self._is_parsed = True
@@ -190,7 +210,11 @@ def number_of_sections(self):
190210

191211
@property
192212
def number_of_volumes(self):
193-
"""int: number of volumes."""
213+
"""Retrieves the number of volumes.
214+
215+
Returns:
216+
int: number of volumes.
217+
"""
194218
if not self._is_parsed:
195219
self._Parse()
196220
self._is_parsed = True
@@ -199,7 +223,11 @@ def number_of_volumes(self):
199223

200224
@property
201225
def sections(self):
202-
"""List[VolumeExtent]: sections."""
226+
"""Retrieves sections.
227+
228+
Returns:
229+
list[VolumeExtent]: sections.
230+
"""
203231
if not self._is_parsed:
204232
self._Parse()
205233
self._is_parsed = True
@@ -208,7 +236,11 @@ def sections(self):
208236

209237
@property
210238
def volume_identifiers(self):
211-
"""List[str]: volume identifiers."""
239+
"""Retrieves volume identifiers.
240+
241+
Returns:
242+
list[str]: volume identifiers.
243+
"""
212244
if not self._is_parsed:
213245
self._Parse()
214246
self._is_parsed = True
@@ -217,7 +249,11 @@ def volume_identifiers(self):
217249

218250
@property
219251
def volumes(self):
220-
"""Generator(Volume): volumes generator."""
252+
"""Retrieves volumes.
253+
254+
Returns:
255+
generator(Volume): volumes generator.
256+
"""
221257
if not self._is_parsed:
222258
self._Parse()
223259
self._is_parsed = True

0 commit comments

Comments
 (0)