Skip to content

Commit

Permalink
Running hooks to fix files.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmasek committed Apr 28, 2019
1 parent 408b554 commit 7d302de
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 38 deletions.
8 changes: 6 additions & 2 deletions TZMBot/cogs/biography.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-

"""Biography Cog for TZMBot discord.py bot."""
from typing import Optional

import discord
from discord.ext import commands

from TZMBot.models import Biography
from typing import Optional


class BiographyCog(commands.Cog):
Expand Down Expand Up @@ -37,7 +39,9 @@ async def get_bio(self, pk: str) -> str:
return bio.content

@commands.command()
async def bio(self, ctx: commands.Context, member: Optional[discord.Member] = None) -> None:
async def bio(
self, ctx: commands.Context, member: Optional[discord.Member] = None
) -> None:
"""A command to get a member biography.
If no member is given, it will return the biography of a caller if it's set.
Expand Down
3 changes: 2 additions & 1 deletion TZMBot/cogs/devtools.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import contextlib
import io
import textwrap
import traceback

import discord
import io
from discord.ext import commands

from TZMBot import settings


Expand Down
3 changes: 2 additions & 1 deletion TZMBot/cogs/global_listeners.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import asyncio
import sys
import traceback

import asyncio
from discord.ext import commands

from TZMBot import settings, utils


Expand Down
4 changes: 3 additions & 1 deletion TZMBot/cogs/loading.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from discord.ext import commands
from importlib import reload

from discord.ext import commands

from TZMBot import settings


Expand Down
3 changes: 2 additions & 1 deletion TZMBot/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

"""Models for TZMBot."""
from tortoise.models import Model
from tortoise import fields
from tortoise.models import Model


class Biography(Model):
Expand All @@ -11,6 +11,7 @@ class Biography(Model):
Defines the biography for the member of the discord server. id is autoincremented, person
represents the member discord id and the content is whatever biography text they might have.
"""

id = fields.IntField(pk=True)
person = fields.TextField(unique=True)
content = fields.TextField(null=True)
Expand Down
1 change: 0 additions & 1 deletion TZMBot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""Settings for TZMBot."""
import os

from typing import List, Tuple

# The base dir is the root of the TZMBot application.
Expand Down
1 change: 0 additions & 1 deletion TZMBot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import discord
from discord.ext.commands import Bot


from TZMBot.settings import COGS

logger = logging.getLogger("__main__")
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
54 changes: 26 additions & 28 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))

sys.path.insert(0, os.path.abspath("../.."))


# -- Project information -----------------------------------------------------

project = 'TZMBot'
copyright = '2019, TZMCommunity'
author = 'TZMCommunity'
project = "TZMBot"
copyright = "2019, TZMCommunity"
author = "TZMCommunity"

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = '0.0.1'
release = "0.0.1"


# -- General configuration ---------------------------------------------------
Expand All @@ -38,21 +39,19 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
]
extensions = ["sphinx.ext.autodoc"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -75,7 +74,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -86,7 +85,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -102,7 +101,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'TZMBotdoc'
htmlhelp_basename = "TZMBotdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -111,15 +110,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -129,19 +125,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'TZMBot.tex', 'TZMBot Documentation',
'TZMCommunity', 'manual'),
(master_doc, "TZMBot.tex", "TZMBot Documentation", "TZMCommunity", "manual")
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'TZMBot', 'TZMBot Documentation',
[author], 1)
]
man_pages = [(master_doc, "TZMBot", "TZMBot Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -150,9 +142,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'TZMBot', 'TZMBot Documentation',
author, 'TZMBot', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"TZMBot",
"TZMBot Documentation",
author,
"TZMBot",
"One line description of project.",
"Miscellaneous",
)
]


Expand All @@ -171,7 +169,7 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
3 changes: 2 additions & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

import asynctest
from tortoise import Tortoise

from TZMBot.cogs.biography import BiographyCog
from TZMBot.models import Biography
from TZMBot.settings import BASE_DIR

TEST_DB_PATH = os.path.join(BASE_DIR, '..', 'test_db.sqlite')
TEST_DB_PATH = os.path.join(BASE_DIR, "..", "test_db.sqlite")
TEST_DB_URL = f"sqlite://{TEST_DB_PATH}"


Expand Down

0 comments on commit 7d302de

Please sign in to comment.