Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit bc858a6

Browse files
committed
[v0.4@misc] Update docs and meta-info
1 parent 90149fb commit bc858a6

6 files changed

Lines changed: 30 additions & 87 deletions

File tree

disctools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
from .abstractions import Cog
55
from .bot import AutoShardedBot, Bot
66
from .commands import *
7-
from .context import EmbedingContext, TargetContext, WebHelperContext
7+
from .context import EmbedingContext, TargetContext
88

9-
__author__ = "TEEN-BOOM"
9+
__author__ = "WizzyGeek"

disctools/__version_info__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
}
77

88
class last_modified:
9-
day = 17
10-
month = 2
9+
day = 28
10+
month = 4
1111
year = 2021
1212

1313
@classmethod
@@ -60,8 +60,8 @@ def __repr__(self) -> str:
6060

6161
version_info = VersionInfo(
6262
major = 0,
63-
minor = 3,
64-
patch = 3,
63+
minor = 4,
64+
patch = 0,
6565
status = status_map["final"],
6666
)
6767

docs/Experimental.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
Experimental
22
============
3-
Untested Helpers.
4-
5-
6-
Installer
7-
---------
8-
.. autoclass:: disctools.experimental.ext_install.Installer
9-
:members:
3+
Untested Helpers. currently none present.

docs/conf.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
# -- Project information -----------------------------------------------------
1717

1818
project = 'DiscTools'
19-
copyright = '2020, TEEN_BOOM'
20-
author = 'TEEN_BOOM'
19+
copyright = '2020, WizzyGeek'
20+
author = 'WizzyGeek'
2121

2222
# The full version, including alpha/beta/rc tags
23-
import disctools
24-
release = disctools.__version__
23+
from disctools.__version_info__ import __version__ as release
2524

2625
# -- General configuration ---------------------------------------------------
2726

@@ -31,7 +30,9 @@
3130
extensions = [
3231
"sphinx_rtd_theme",
3332
"sphinx.ext.napoleon",
34-
"sphinx.ext.autodoc"
33+
"sphinx.ext.autodoc",
34+
"sphinx.ext.intersphinx",
35+
"sphinx.ext.viewcode"
3536
]
3637
# Add any paths that contain templates here, relative to this directory.
3738
templates_path = ['_templates']
@@ -42,9 +43,9 @@
4243
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
4344

4445
rst_prolog = """
45-
.. |overridecoro| replace:: This function is a |corourl|_ and it shall be over rided.
46+
.. |overridecoro| replace:: This function is a |corourl|_ and it may be overrided.
4647
.. |coro| replace:: This function is a |corourl|_.
47-
.. |maybecoro| replace:: This function *could be a* |corourl|_.
48+
.. |maybecoro| replace:: This function *may be a* |corourl|_.
4849
.. |corourl| replace:: *coroutine*
4950
.. _corourl: https://docs.python.org/3/library/asyncio-task.html#coroutine
5051
"""
@@ -61,7 +62,7 @@
6162
# Add any paths that contain custom static files (such as style sheets) here,
6263
# relative to this directory. They are copied after the builtin static files,
6364
# so a file named "default.css" will overwrite the builtin "default.css".
64-
html_static_path = ['_static']
65+
# html_static_path = ['_static']
6566

6667
napoleon_numpy_docstring = True
6768
napoleon_include_init_with_doc = False
@@ -73,4 +74,9 @@
7374
napoleon_use_ivar = False
7475
napoleon_use_param = True
7576
napoleon_use_rtype = True
76-
napoleon_type_aliases = None
77+
napoleon_type_aliases = None
78+
79+
intersphinx_mapping = {
80+
'python': ('https://docs.python.org/3', None),
81+
'discord': ('https://discordpy.readthedocs.io/en/latest', None)
82+
}

docs/index.rst

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,75 +3,20 @@ DiscTools
33

44
About
55
-----
6-
This library is about discord.py helper classes, functions and alternatives, which can not (& should not) be included in discord.py library.
6+
This library is about discord.py helper classes, functions and alternatives.
77

88
Installation
99
------------
10-
Can be simply done with ``pip install DiscTools``.
11-
Or you can get the freshly harvested code by ``pip install git+https://github.com/TEEN-BOOM/DiscTools.git@master#egg=DiscTools``
10+
``pip install DiscTools``
11+
Or you can install the dev version by ``pip install git+https://github.com/TEEN-BOOM/DiscTools.git@master#egg=DiscTools``
1212

1313

1414
Example
1515
-------
1616
A basic Bot using DiscTools
1717

18-
.. code-block:: python3
19-
20-
import disctools
21-
from discord.ext import commands
22-
import logging
23-
24-
logging.basicConfig(
25-
format='%(asctime)s | %(name)s | %(levelname)s:: %(message)s',
26-
datefmt="[%X]",
27-
level=logging.INFO
28-
)
29-
Bot = disctools.Bot("~")
30-
31-
@Bot.inject(name="Test", invoke_without_subcommand=False)
32-
class test(disctools.CCmd):
33-
async def main(self, ctx):
34-
await ctx.send("PASS")
35-
36-
async def subcommand_before_invoke(self, ctx):
37-
await ctx.send("Test before hook PASS")
38-
39-
async def subcommand_after_invoke(self, ctx):
40-
await ctx.send("Test after hook PASS")
41-
42-
@disctools.inject()
43-
class First(disctools.Command):
44-
# Usage: `[p]Test First Hi!`
45-
async def pre_invoke(self, parent, ctx):
46-
return await ctx.send("Preparing...")
47-
48-
async def main(self, parent, ctx, *, msg: str = "PASS"):
49-
return await ctx.send(msg)
50-
51-
async def post_invoke(self, parent, ctx):
52-
return await ctx.send("Exiting...")
53-
54-
class Second(disctools.ICommand, aliases=["s"]):
55-
# Usage: `[p]Test [Second|s] Hi!`
56-
async def main(self, parent, ctx, *, msg: str = "PASS"):
57-
"""Interact with discord here, you may write everything here."""
58-
return await ctx.send(self.logic(msg))
59-
60-
async def logic(self, msg):
61-
"""Platform agnostic implementation of the command
62-
63-
This is not enforced but recommended; it's easier to migrate from discord
64-
if the need arises in future"""
65-
return msg
66-
67-
# You may do this but, without disctools.Command you lose the self argument.
68-
@commands.command(cls=disctools.Command, name="Third")
69-
async def third(self, ctx, *, msg: str = "PASS"):
70-
return await ctx.send(msg)
71-
72-
Bot.run("<TOKEN>")
73-
74-
18+
.. literalinclude :: ../examples/basic.py
19+
:language: python3
7520
7621
.. toctree::
7722
:maxdepth: 2

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
setup(
1414
name="DiscTools",
1515
version=version,
16-
author="teen_boom",
16+
author="WizzyGeek",
1717
author_email="ojasscoding@gmail.com",
1818
description="discord.py helper classes, functions & alternatives",
1919
long_description=long_description,
2020
long_description_content_type="text/markdown",
2121
install_requires=requirements,
22-
url="https://github.com/TEEN-BOOM/DiscTools",
22+
url="https://github.com/WizzyGeek/DiscTools",
2323
license='MIT',
2424
test_suite="tests",
2525
packages=[
@@ -30,11 +30,9 @@
3030
"Programming Language :: Python :: 3",
3131
"License :: OSI Approved :: MIT License",
3232
"Operating System :: OS Independent",
33-
"License :: OSI Approved :: MIT License",
34-
"Operating System :: OS Independent",
3533
"Programming Language :: Python :: Implementation :: CPython"
3634
],
37-
python_requires='>=3.6',
35+
python_requires='>=3.8',
3836
extras_require={
3937
"docs": [
4038
"Sphinx~=3.1.2",

0 commit comments

Comments
 (0)