Bugfixes
This commit is contained in:
parent
593ffbb068
commit
f9f04901c0
0
scripts/build.sh
Normal file → Executable file
0
scripts/build.sh
Normal file → Executable file
0
scripts/chrome.sh
Normal file → Executable file
0
scripts/chrome.sh
Normal file → Executable file
0
scripts/create_docs.sh
Normal file → Executable file
0
scripts/create_docs.sh
Normal file → Executable file
0
scripts/publish.sh
Normal file → Executable file
0
scripts/publish.sh
Normal file → Executable file
@ -333,7 +333,7 @@ class PublisherService(PublisherABC):
|
|||||||
length = len(self._build_settings.main.split('.'))
|
length = len(self._build_settings.main.split('.'))
|
||||||
main_name = self._build_settings.main.split('.')[length - 1]
|
main_name = self._build_settings.main.split('.')[length - 1]
|
||||||
|
|
||||||
sys.path.insert(0, self._source_path)
|
sys.path.insert(0, os.path.join(self._source_path, '../'))
|
||||||
main_mod = __import__(self._build_settings.main)
|
main_mod = __import__(self._build_settings.main)
|
||||||
main = getattr(main_mod, main_name)
|
main = getattr(main_mod, main_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
42
src/tests/generated/simple-app/cpl.json
Normal file
42
src/tests/generated/simple-app/cpl.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "simple-app",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl==2021.4.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "src",
|
||||||
|
"OutputPath": "dist",
|
||||||
|
"Main": "main",
|
||||||
|
"EntryPoint": "simple-app",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {}
|
||||||
|
}
|
||||||
|
}
|
16
src/tests/generated/simple-app/src/application.py
Normal file
16
src/tests/generated/simple-app/src/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl.application import ApplicationABC
|
||||||
|
from cpl.configuration import ConfigurationABC
|
||||||
|
from cpl.console import Console
|
||||||
|
from cpl.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def main(self):
|
||||||
|
Console.write_line('Hello World')
|
12
src/tests/generated/simple-app/src/main.py
Normal file
12
src/tests/generated/simple-app/src/main.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from cpl.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from application import Application
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.build().run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
42
src/tests/generated/simple-console/cpl.json
Normal file
42
src/tests/generated/simple-console/cpl.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "simple-console",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl==2021.4.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "src",
|
||||||
|
"OutputPath": "dist",
|
||||||
|
"Main": "main",
|
||||||
|
"EntryPoint": "simple-console",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {}
|
||||||
|
}
|
||||||
|
}
|
9
src/tests/generated/simple-console/src/main.py
Normal file
9
src/tests/generated/simple-console/src/main.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from cpl.console import Console
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
Console.write_line('Hello World')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
42
src/tests/generated/simple-di/cpl.json
Normal file
42
src/tests/generated/simple-di/cpl.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "simple-di",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl==2021.4.2.dev1"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "src",
|
||||||
|
"OutputPath": "dist",
|
||||||
|
"Main": "main",
|
||||||
|
"EntryPoint": "simple-di",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {}
|
||||||
|
}
|
||||||
|
}
|
23
src/tests/generated/simple-di/src/main.py
Normal file
23
src/tests/generated/simple-di/src/main.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from cpl.configuration import Configuration, ConfigurationABC
|
||||||
|
from cpl.console import Console
|
||||||
|
from cpl.dependency_injection import ServiceCollection, ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
def configure_configuration() -> ConfigurationABC:
|
||||||
|
config = Configuration()
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
def configure_services(config: ConfigurationABC) -> ServiceProviderABC:
|
||||||
|
services = ServiceCollection(config)
|
||||||
|
return services.build_service_provider()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
config = configure_configuration()
|
||||||
|
provider = configure_services(config)
|
||||||
|
Console.write_line('Hello World')
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
0
src/tests/generated/startup-app/LICENSE
Normal file
0
src/tests/generated/startup-app/LICENSE
Normal file
0
src/tests/generated/startup-app/README.md
Normal file
0
src/tests/generated/startup-app/README.md
Normal file
42
src/tests/generated/startup-app/cpl.json
Normal file
42
src/tests/generated/startup-app/cpl.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "startup-app",
|
||||||
|
"Version": {
|
||||||
|
"Major": "0",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0"
|
||||||
|
},
|
||||||
|
"Author": "",
|
||||||
|
"AuthorEmail": "",
|
||||||
|
"Description": "",
|
||||||
|
"LongDescription": "",
|
||||||
|
"URL": "",
|
||||||
|
"CopyrightDate": "",
|
||||||
|
"CopyrightName": "",
|
||||||
|
"LicenseName": "",
|
||||||
|
"LicenseDescription": "",
|
||||||
|
"Dependencies": [
|
||||||
|
"sh_cpl==2021.4.2"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.9.2",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "src",
|
||||||
|
"OutputPath": "dist",
|
||||||
|
"Main": "main",
|
||||||
|
"EntryPoint": "startup-app",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {}
|
||||||
|
}
|
||||||
|
}
|
16
src/tests/generated/startup-app/src/application.py
Normal file
16
src/tests/generated/startup-app/src/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl.application import ApplicationABC
|
||||||
|
from cpl.configuration import ConfigurationABC
|
||||||
|
from cpl.console import Console
|
||||||
|
from cpl.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def main(self):
|
||||||
|
Console.write_line('Hello World')
|
14
src/tests/generated/startup-app/src/main.py
Normal file
14
src/tests/generated/startup-app/src/main.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from cpl.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from application import Application
|
||||||
|
from startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app_builder.build().run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
20
src/tests/generated/startup-app/src/startup.py
Normal file
20
src/tests/generated/startup-app/src/startup.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from cpl.application import StartupABC
|
||||||
|
from cpl.configuration import ConfigurationABC
|
||||||
|
from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
self._configuration = config
|
||||||
|
self._environment = self._configuration.environment
|
||||||
|
self._services = services
|
||||||
|
|
||||||
|
def configure_configuration(self) -> ConfigurationABC:
|
||||||
|
return self._configuration
|
||||||
|
|
||||||
|
def configure_services(self) -> ServiceProviderABC:
|
||||||
|
return self._services.build_service_provider()
|
||||||
|
|
1
src/tests/generated/startup-app/src/tests/__init__.py
Normal file
1
src/tests/generated/startup-app/src/tests/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
Loading…
Reference in New Issue
Block a user