Excluded tests from package build
parent
ecdcda1c36
commit
df89d6796b
|
@ -3,6 +3,7 @@
|
|||
## Unreleased
|
||||
### Added
|
||||
- Prefix can now be passed as argument to init
|
||||
- Pre-made help module
|
||||
|
||||
### Fixed
|
||||
- Buggy 'default' cached_property
|
||||
|
|
|
@ -35,6 +35,7 @@ This first part shows the three important variables in any module.
|
|||
def pre_start(self):
|
||||
self.some_var = 'a value needed for working'
|
||||
```
|
||||
|
||||
The pre_start function is where you define any variables which should be created before any daemons are started or
|
||||
commands are run. I don't recommend overwriting `__init__`, as this might break compatibility with future versions of
|
||||
Frank.
|
||||
|
|
|
@ -46,7 +46,9 @@ class Frank(discord.Client):
|
|||
self._config = None
|
||||
|
||||
async def on_ready(self):
|
||||
"""Runs when the bot has succesfully connected to Discord"""
|
||||
"""
|
||||
Runs when the bot has succesfully connected to Discord
|
||||
"""
|
||||
|
||||
print('Connected')
|
||||
|
||||
|
@ -64,7 +66,9 @@ class Frank(discord.Client):
|
|||
print('All modules loaded')
|
||||
|
||||
async def stop(self):
|
||||
"""Stop all module daemons and exit."""
|
||||
"""
|
||||
Stop all module daemons and exit.
|
||||
"""
|
||||
|
||||
for module in self._loaded_modules:
|
||||
await module.stop()
|
||||
|
|
|
@ -24,17 +24,25 @@ if TYPE_CHECKING:
|
|||
|
||||
|
||||
class Module(ModuleMeta):
|
||||
"""Base class for modules; all custom modules should inherit from this."""
|
||||
"""
|
||||
Base class for modules; all custom modules should inherit from this.
|
||||
"""
|
||||
|
||||
PREFIX = []
|
||||
"""Prefix to activate this module."""
|
||||
"""
|
||||
Prefix to activate this module.
|
||||
"""
|
||||
|
||||
NAME = ''
|
||||
"""The name is used in various places, such as the config file and the
|
||||
help function."""
|
||||
"""
|
||||
The name is used in various places, such as the config file and the
|
||||
help function.
|
||||
"""
|
||||
|
||||
HELP = ''
|
||||
"""Short description of the module to use in the help function."""
|
||||
"""
|
||||
Short description of the module to use in the help function.
|
||||
"""
|
||||
|
||||
def __init__(self, client: Frank, config: Dict = None):
|
||||
"""
|
||||
|
@ -43,6 +51,7 @@ class Module(ModuleMeta):
|
|||
config: dict containing the config for this module (Frank client
|
||||
reads this from the config file).
|
||||
"""
|
||||
|
||||
super().__init__()
|
||||
|
||||
self._client = client
|
||||
|
@ -68,7 +77,9 @@ class Module(ModuleMeta):
|
|||
self._tasks.append(task)
|
||||
|
||||
async def stop(self):
|
||||
"""Stop all tasks for this module."""
|
||||
"""
|
||||
Stop all tasks for this module.
|
||||
"""
|
||||
|
||||
for task in self._tasks:
|
||||
task.cancel()
|
||||
|
|
2
setup.py
2
setup.py
|
@ -18,7 +18,7 @@ setuptools.setup(
|
|||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
url='https://gitlab.com/Chewing_Bever/frank',
|
||||
packages=setuptools.find_packages(),
|
||||
packages=setuptools.find_packages(exclude=('tests',)),
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Environment :: No Input/Output (Daemon)',
|
||||
|
|
Reference in New Issue