Skip to content

Commit 01928c4

Browse files
committed
Cleaned up a few docstrings and removed dead South introspections.
1 parent 9f9f861 commit 01928c4

8 files changed

Lines changed: 15 additions & 30 deletions

File tree

api/admin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/python
21
# -*- coding: utf-8 -*-
32

43
"""

api/exceptions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Deis exception classes.
2+
Deis API exception classes.
33
"""
44

55
from __future__ import unicode_literals
@@ -9,7 +9,12 @@
99

1010

1111
class BuildNodeError(APIException):
12-
"""Indicates a problem in building or bootstrapping a node."""
12+
"""
13+
Indicates a problem in building or bootstrapping a node.
14+
15+
This exception is subclassed from rest_framework's APIException so it
16+
isn't reported as "500 SERVER ERROR."
17+
"""
1318

1419
status_code = status.HTTP_401_UNAUTHORIZED
1520

api/fields.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111

1212
class UuidField(models.CharField):
13-
1413
"""A univerally unique ID field."""
15-
# pylint: disable=R0904
1614

1715
description = __doc__
1816

@@ -24,13 +22,11 @@ def __init__(self, *args, **kwargs):
2422
super(UuidField, self).__init__(*args, **kwargs)
2523

2624
def db_type(self, connection=None):
27-
"""Return the database type for a UuidField."""
28-
db_type = None
25+
"""Return the database column type for a UuidField."""
2926
if connection and 'postgres' in connection.vendor:
30-
db_type = 'uuid'
27+
return 'uuid'
3128
else:
32-
db_type = "char({})".format(self.max_length)
33-
return db_type
29+
return "char({})".format(self.max_length)
3430

3531
def pre_save(self, model_instance, add):
3632
"""Initialize an empty field with a new UUID before it is saved."""
@@ -55,12 +51,5 @@ def formfield(self, **kwargs):
5551
from south.modelsinspector import add_introspection_rules
5652
# Tell the South schema migration tool to handle our custom fields.
5753
add_introspection_rules([], [r'^api\.fields\.UuidField'])
58-
add_introspection_rules([], [r'^api\.fields\.EnvVarsField'])
59-
add_introspection_rules([], [r'^api\.fields\.DataBagField'])
60-
add_introspection_rules([], [r'^api\.fields\.ProcfileField'])
61-
add_introspection_rules([], [r'^api\.fields\.CredentialsField'])
62-
add_introspection_rules([], [r'^api\.fields\.ParamsField'])
63-
add_introspection_rules([], [r'^api\.fields\.CloudInitField'])
64-
add_introspection_rules([], [r'^api\.fields\.NodeStatusField'])
6554
except ImportError: # pragma: no cover
6655
pass

api/models.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#!/usr/bin/python
21
# -*- coding: utf-8 -*-
32

43
"""
54
Data models for the Deis API.
65
"""
7-
# pylint: disable=R0903,W0232
86

97
from __future__ import unicode_literals
108
import importlib
@@ -36,7 +34,6 @@
3634

3735
# base models
3836

39-
4037
class AuditedModel(models.Model):
4138
"""Add created and updated fields to a model."""
4239

@@ -57,8 +54,8 @@ class Meta:
5754
"""Mark :class:`UuidAuditedModel` as abstract."""
5855
abstract = True
5956

60-
# deis core models
6157

58+
# deis core models
6259

6360
@python_2_unicode_compatible
6461
class Key(UuidAuditedModel):
@@ -127,7 +124,7 @@ def __str__(self):
127124

128125

129126
class FlavorManager(models.Manager):
130-
"""Manage database interactions for :class:`Flavor`."""
127+
"""Manage database interactions for :class:`Flavor`\s."""
131128

132129
def seed(self, user, **kwargs):
133130
"""Seed the database with default Flavors for each cloud region."""
@@ -164,7 +161,6 @@ def __str__(self):
164161

165162
@python_2_unicode_compatible
166163
class Formation(UuidAuditedModel):
167-
168164
"""
169165
Formation of nodes used to host applications
170166
"""
@@ -250,7 +246,6 @@ def calculate(self):
250246

251247
@python_2_unicode_compatible
252248
class Layer(UuidAuditedModel):
253-
254249
"""
255250
Layer of nodes used by the formation
256251
@@ -763,7 +758,7 @@ class Release(UuidAuditedModel):
763758
"""
764759
Software release deployed by the application platform
765760
766-
Releases contain a Build and a Config.
761+
Releases contain a :class:`Build` and a :class:`Config`.
767762
"""
768763

769764
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
@@ -844,10 +839,10 @@ def _user_purge(self):
844839
User.publish = _user_publish
845840
User.purge = _user_purge
846841

842+
847843
# define update/delete callbacks for synchronizing
848844
# models with the configuration management backend
849845

850-
851846
def _publish_to_cm(**kwargs):
852847
kwargs['instance'].publish()
853848

api/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""
22
Classes to serialize the RESTful representation of Deis API models.
33
"""
4-
# pylint: disable=R0903,W0232
54

65
from __future__ import unicode_literals
76

client/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
KWARGS = {'scripts': ['deis']}
3131

3232

33-
# pylint: disable=W0142
3433
setup(name='deis',
3534
version='0.4.0',
3635
license=APACHE_LICENSE,

deis/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
admin.autodiscover()
1515

1616

17-
# pylint: disable=C0103
1817
urlpatterns = patterns(
1918
'',
2019
url(r'^accounts/', include('allauth.urls')),

deis/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# file. This includes Django's development server, if the WSGI_APPLICATION
2828
# setting points here.
2929
from django.core.wsgi import get_wsgi_application
30-
application = get_wsgi_application() # pylint: disable=C0103
30+
application = get_wsgi_application()
3131

3232
# Apply WSGI middleware here.
3333
# from helloworld.wsgi import HelloWorldApplication

0 commit comments

Comments
 (0)