Skip to content

Commit 46904a4

Browse files
committed
Reorganize import statements based on pep conventions
1 parent e1272ff commit 46904a4

File tree

10 files changed

+29
-36
lines changed

10 files changed

+29
-36
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Did you accidentally send something you didn't mean to with the `reply` command?
6363

6464
### Thread Logs
6565

66-
Thread conversations are automatically logged and a log link is provided with each thread. Logs are rendered with HTML and are presented in an aesthetically pleasing way, exactly like on discord, this especially integrates seamlessly with the mobile version of discord. Heres a link to an [example](https://logs.modmail.tk/02032d65a6f3).
66+
Thread conversations are automatically logged and a log link is provided with each thread. Logs are rendered with HTML and are presented in an aesthetically pleasing way, exactly like on discord, this especially integrates seamlessly with the mobile version of discord. Here's a link to an [example](https://logs.modmail.tk/02032d65a6f3).
6767

6868
### Automatic Updates
6969
The bot checks for new updates every hour and automatically updates to a newer version if found. This bot is under active development so you can always look forward to new, useful features! If you do not want this functionality, for example, if you want to make changes to your fork, you can do so by adding a `disable_autoupdates` config variable.

bot.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,26 @@
2525
__version__ = '2.11.0'
2626

2727
import asyncio
28+
from datetime import datetime
2829
from os import listdir
2930
from textwrap import dedent
30-
from datetime import datetime
3131
from types import SimpleNamespace
3232

3333
import discord
34-
from discord.enums import ActivityType
35-
from discord.ext import commands
36-
from discord.ext.commands.view import StringView
37-
3834
import uvloop
3935
from aiohttp import ClientSession
40-
from motor.motor_asyncio import AsyncIOMotorClient
4136
from colorama import init, Fore, Style
37+
from discord.enums import ActivityType
38+
from discord.ext import commands
39+
from discord.ext.commands.view import StringView
4240
from emoji import UNICODE_EMOJI
41+
from motor.motor_asyncio import AsyncIOMotorClient
4342

43+
from core.changelog import ChangeLog
4444
from core.clients import ModmailApiClient, SelfHostedClient
45-
from core.thread import ThreadManager
4645
from core.config import ConfigManager
47-
from core.changelog import ChangeLog
4846
from core.models import Bot
47+
from core.thread import ThreadManager
4948

5049
init()
5150

cogs/modmail.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
from asyncio import gather
12
from datetime import datetime
23
from typing import Optional, Union
3-
from asyncio import gather
44

55
import discord
6-
from discord.ext import commands
7-
86
from dateutil import parser
7+
from discord.ext import commands
98

109
from core.decorators import trigger_typing
10+
from core.models import Bot
1111
from core.paginator import PaginatorSession
1212
from core.time import UserFriendlyTime, human_timedelta
1313
from core.utils import truncate, User
14-
from core.models import Bot
1514

1615

1716
class Modmail:

cogs/utility.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
import traceback
21
import inspect
2+
import traceback
3+
from contextlib import redirect_stdout
4+
from datetime import datetime
5+
from difflib import get_close_matches
36
from io import StringIO
47
from json import JSONDecodeError
5-
from datetime import datetime
68
from textwrap import indent
7-
from contextlib import redirect_stdout
8-
from difflib import get_close_matches
99

10+
from aiohttp import ClientResponseError
1011
from discord import Embed, Color, Activity
11-
from discord.ext import commands
1212
from discord.enums import ActivityType
13+
from discord.ext import commands
1314

14-
from aiohttp import ClientResponseError
15-
16-
from core.paginator import PaginatorSession
17-
from core.decorators import auth_required, owner_only, trigger_typing
1815
from core.changelog import ChangeLog
19-
from core.utils import cleanup_code
16+
from core.decorators import auth_required, owner_only, trigger_typing
2017
from core.models import Bot
18+
from core.paginator import PaginatorSession
19+
from core.utils import cleanup_code
2120

2221

2322
class Utility:

core/changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
2-
from typing import List
32
from collections import defaultdict
3+
from typing import List
44

55
from discord import Embed, Color
66

core/clients.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import secrets
22
from datetime import datetime
3-
from typing import Union, Optional
43
from json import JSONDecodeError
5-
6-
from discord import Member, DMChannel
4+
from typing import Union, Optional
75

86
from aiohttp import ClientResponseError, ClientResponse
7+
from discord import Member, DMChannel
98
from pymongo import ReturnDocument
109

1110
from core.models import Bot, UserClient

core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
2-
import os
32
import json
3+
import os
44

55
from core.models import Bot, ConfigManagerABC
66

core/models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
import typing
44
from datetime import datetime
55

6-
from discord import Message, TextChannel, Guild
6+
from aiohttp import ClientSession
77
from discord import Color, Member, User, CategoryChannel, DMChannel
8+
from discord import Message, TextChannel, Guild
89
from discord.ext import commands
9-
10-
from aiohttp import ClientSession
1110
from motor.motor_asyncio import AsyncIOMotorClient
1211

1312

core/thread.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
import asyncio
12
import re
23
import string
3-
import asyncio
44
import typing
55
from datetime import datetime, timedelta
66

77
import discord
88
from discord.ext.commands import UserInputError, CommandError
99

10-
11-
from core.utils import is_image_url, days, match_user_id
1210
from core.models import Bot, ThreadManagerABC, ThreadABC
11+
from core.utils import is_image_url, days, match_user_id
1312

1413

1514
class Thread(ThreadABC):

core/time.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
import re
77
from datetime import datetime
88

9-
from discord.ext.commands import BadArgument, Converter
10-
119
import parsedatetime as pdt
1210
from dateutil.relativedelta import relativedelta
11+
from discord.ext.commands import BadArgument, Converter
1312

1413

1514
class ShortTime:

0 commit comments

Comments
 (0)