Skip to content

Commit

Permalink
docs: barebones template application
Browse files Browse the repository at this point in the history
  • Loading branch information
naman108 committed Nov 27, 2024
1 parent 3c46ad5 commit 30f5aec
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This is a template application configuration file for a DigitalPy application.
; The application configuration will configure object in the ConfigurationFactory.
; These objects will store configuration data and can be used by the application.
; Some configuration objects are used to configure components, and others are used to configure services.
; Below is an example of a service configuration for a simple TCP service.
; [dp_application.simple_tcp]
; __class = digitalpy.core.service_management.domain.model.service_configuration.ServiceConfiguration
; status = STOPPED
; name = SimpleTCPService
; port = 8443
; host = 0.0.0.0
; protocol = TCPNetwork

; The application configuration file must be updated to include the service configuration of any new services.
; For example, the following configuration will add a new service configuration for a simple TCP service.
; [ServiceManagementConfiguration]
; __class = digitalpy.core.service_management.domain.model.service_management_configuration.ServiceManagementConfiguration
; services = [dp_helloworld.simple_tcp]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This is the object configuration file for your DigitalPy Application
; You can define your objects here and use them in your application
; via the ObjectFactory. New objects can be added by creating a new
; section and defining the object's properties and class. For example:
; [my_new_object]
; __class = my_app.my_module.MyClass
; named_init_arg1 = value1
; named_init_arg2 = value2

; You can also update the configuration defaults of the digitalpy framework,
; by adding a new section and defining the properties you want to override.
; For example:
;[digitalpy.core_api]
;blueprint_path = NewPath/To/My/blueprints/
;blueprint_import_base = MyDifferentRoute.blueprints
33 changes: 33 additions & 0 deletions examples/template_application/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Main module for a DigitalPy application.
This script defines the main class for a DigitalPy application,
which serves as the entry point for the application.
"""

from digitalpy.core.main.DigitalPy import DigitalPy


class DigitalPyApp(DigitalPy):
"""
Main class for the DigitalPy application.
This class inherits from DigitalPy and initializes the application
with the required configuration and setup.
"""

def __init__(self):
"""
Initialize the DigitalPyApp instance.
This constructor initializes the base DigitalPy class and
configures the application by calling the _initialize_app_configuration method.
"""
super().__init__()
self._initialize_app_configuration()

if __name__ == "__main__":
# Entry point for the DigitalPy application.
#
# This block ensures that the application starts only when executed as a script.
DigitalPyApp().start()
Empty file.

0 comments on commit 30f5aec

Please sign in to comment.