@@ -96,7 +96,6 @@ def commit_name(self):
96
96
The result could be used as ref in a git repo, e.g. for linking to
97
97
GitHub or Bitbucket.
98
98
"""
99
-
100
99
# LATEST is special as it is usually a branch but does not contain the
101
100
# name in verbose_name.
102
101
if self .slug == LATEST :
@@ -141,9 +140,7 @@ def get_absolute_url(self):
141
140
return self .project .get_docs_url (version_slug = self .slug , private = private )
142
141
143
142
def save (self , * args , ** kwargs ):
144
- """
145
- Add permissions to the Version for all owners on save.
146
- """
143
+ """Add permissions to the Version for all owners on save."""
147
144
from readthedocs .projects import tasks
148
145
obj = super (Version , self ).save (* args , ** kwargs )
149
146
for owner in self .project .users .all ():
@@ -164,7 +161,7 @@ def delete(self, *args, **kwargs):
164
161
165
162
@property
166
163
def identifier_friendly (self ):
167
- ''' Return display friendly identifier'''
164
+ """ Return display friendly identifier"""
168
165
if re .match (r'^[0-9a-f]{40}$' , self .identifier , re .I ):
169
166
return self .identifier [:8 ]
170
167
return self .identifier
@@ -201,18 +198,18 @@ def get_conf_py_path(self):
201
198
return conf_py_path
202
199
203
200
def get_build_path (self ):
204
- ''' Return version build path if path exists, otherwise `None`'''
201
+ """ Return version build path if path exists, otherwise `None`"""
205
202
path = self .project .checkout_path (version = self .slug )
206
203
if os .path .exists (path ):
207
204
return path
208
205
return None
209
206
210
207
def clean_build_path (self ):
211
- ''' Clean build path for project version
208
+ """ Clean build path for project version
212
209
213
210
Ensure build path is clean for project version. Used to ensure stale
214
211
build checkouts for each project version are removed.
215
- '''
212
+ """
216
213
try :
217
214
path = self .get_build_path ()
218
215
if path is not None :
@@ -349,28 +346,29 @@ def get_absolute_url(self):
349
346
350
347
@property
351
348
def finished (self ):
352
- ''' Return if build has a finished state'''
349
+ """ Return if build has a finished state"""
353
350
return self .state == BUILD_STATE_FINISHED
354
351
355
352
356
353
class BuildCommandResultMixin (object ):
357
354
358
- ''' Mixin for common command result methods/properties
355
+ """ Mixin for common command result methods/properties
359
356
360
357
Shared methods between the database model :py:class:`BuildCommandResult` and
361
358
non-model respresentations of build command results from the API
362
- '''
359
+ """
363
360
364
361
@property
365
362
def successful (self ):
366
- ''' Did the command exit with a successful exit code'''
363
+ """ Did the command exit with a successful exit code"""
367
364
return self .exit_code == 0
368
365
369
366
@property
370
367
def failed (self ):
371
- ''' Did the command exit with a failing exit code
368
+ """ Did the command exit with a failing exit code
372
369
373
- Helper for inverse of :py:meth:`successful`'''
370
+ Helper for inverse of :py:meth:`successful`
371
+ """
374
372
return not self .successful
375
373
376
374
0 commit comments