Skip to content

Commit

Permalink
fixup! Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
SerenityIK committed Dec 7, 2020
1 parent ae24b6c commit ffd1163
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
4 changes: 1 addition & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'''
Initializing application
'''
"""Initializing application."""

import logging
import os
Expand Down
4 changes: 1 addition & 3 deletions app/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'''
Initializing API
'''
"""Initializing API."""

from flask import Blueprint

Expand Down
4 changes: 1 addition & 3 deletions app/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'''
Initializing authentication blueprint
'''
"""Initializing authentication blueprint."""

from flask import Blueprint

Expand Down
2 changes: 1 addition & 1 deletion app/auth/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'''Classes of authentication forms'''
"""Classes of authentication forms."""

from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
Expand Down
2 changes: 2 additions & 0 deletions app/errors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Initializing errors blueprint."""

from flask import Blueprint


Expand Down
4 changes: 1 addition & 3 deletions app/main/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'''
Initializing main blueprint
'''
"""Initializing main blueprint."""

from flask import Blueprint

Expand Down
5 changes: 2 additions & 3 deletions app/main/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'''
Classes of general forms
'''
"""Classes of general forms."""

from flask import request
from flask_wtf import FlaskForm
Expand Down Expand Up @@ -54,6 +52,7 @@ class SearchForm(FlaskForm):
q = StringField(_l('Search'), validators=[DataRequired()])

def __init__(self, *args, **kwargs):
"""Search form class."""
if 'formdata' not in kwargs:
kwargs['formdata'] = request.args
if 'csrf_enabled' not in kwargs:
Expand Down
4 changes: 3 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class User(db.Model, UserMixin, PaginatedAPIMixin):
token_expiration = db.Column(db.DateTime)

def __repr__(self):
'''Returning string "User <username>"'''
"""Returning string 'User <username>'."""
return '<User {}>'.format(self.username)

def set_password(self, password):
Expand Down Expand Up @@ -247,6 +247,7 @@ class Post(SearchableMixin, db.Model):
language = db.Column(db.String(5))

def __repr__(self):
"""Returning post body string."""
return 'Post {}'.format(self.body)


Expand All @@ -258,6 +259,7 @@ class Message(db.Model):
timestamp = db.Column(db.DateTime, index=True, default=datetime.utcnow)

def __repr__(self):
"""Returning message body string."""
return '<Message {}>'.format(self.body)


Expand Down

0 comments on commit ffd1163

Please sign in to comment.