Skip to content

we1come32/modular-application-architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Modular application architecture

How to use:

  1. Create file <module_name>.py in directory modules
  2. In the <module_name>.py: from . import command
  3. Create a function, describe its name and command
  4. in init.py add to list modules <module_name>
  5. to import main models
  6. data = modules.load()

Result:

  • data['commands'] - a list of teams with their names
  • data['errors'] - a list of modules in which an import error occurred

Example: File main.py

import importlib
modules = importlib.import_module('modules')

File modules/__init__.py:

modules = [
    'admins',
]

......

File modules/admins.py

from . import command

@command(name="Hello, world", command="hello")
def hello_world(*data, **kwargs):
    print("Hello, world")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages