2022.7 - cpl-discord #96
0
src/tests/custom/discord/LICENSE
Normal file
0
src/tests/custom/discord/LICENSE
Normal file
0
src/tests/custom/discord/README.md
Normal file
0
src/tests/custom/discord/README.md
Normal file
9
src/tests/custom/discord/cpl-workspace.json
Normal file
9
src/tests/custom/discord/cpl-workspace.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"WorkspaceSettings": {
|
||||||
|
"DefaultProject": "discord",
|
||||||
|
"Projects": {
|
||||||
|
"discord": "src/discord/discord.json"
|
||||||
|
},
|
||||||
|
"Scripts": {}
|
||||||
|
}
|
||||||
|
}
|
1
src/tests/custom/discord/src/discord/__init__.py
Normal file
1
src/tests/custom/discord/src/discord/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
16
src/tests/custom/discord/src/discord/application.py
Normal file
16
src/tests/custom/discord/src/discord/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import ApplicationABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.console import Console
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
async def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
async def main(self):
|
||||||
|
Console.write_line('Hello World')
|
46
src/tests/custom/discord/src/discord/discord.json
Normal file
46
src/tests/custom/discord/src/discord/discord.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "discord",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "discord.main",
|
||||||
|
"EntryPoint": "discord",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
17
src/tests/custom/discord/src/discord/main.py
Normal file
17
src/tests/custom/discord/src/discord/main.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import asyncio
|
||||||
|
|
||||||
|
from cpl_core.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from discord.application import Application
|
||||||
|
from discord.startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app: Application = await app_builder.build_async()
|
||||||
|
await app.run_async()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
asyncio.run(main())
|
16
src/tests/custom/discord/src/discord/startup.py
Normal file
16
src/tests/custom/discord/src/discord/startup.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import StartupABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
from cpl_core.environment import ApplicationEnvironment
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||||
|
return configuration
|
||||||
|
|
||||||
|
def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||||
|
return services.build_service_provider()
|
1
src/tests/custom/discord/src/tests/__init__.py
Normal file
1
src/tests/custom/discord/src/tests/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
Loading…
Reference in New Issue
Block a user