Server IP : 85.214.239.14 / Your IP : 3.137.174.253 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /srv/modoboa/env/lib64/python3.5/site-packages/modoboa/admin/management/commands/ |
Upload File : |
"""Modoboa main management command.""" from django.core.management.base import BaseCommand from .subcommands._export import ExportCommand from .subcommands._import import ImportCommand from .subcommands._manage_dkim_keys import ManageDKIMKeys from .subcommands._mx import CheckMXRecords from .subcommands._repair import Repair class Command(BaseCommand): """Top management command for modoboa. $ python manage.py modo """ help = "Modoboa top management command." subcommands = { "export": ExportCommand, "import": ImportCommand, "check_mx": CheckMXRecords, "manage_dkim_keys": ManageDKIMKeys, "repair": Repair, } def add_arguments(self, parser): subparsers = parser.add_subparsers( dest='subcommand', title='subcommands' ) # required argument is added in Python 3.7 subparsers.required = True for command_name, command_class in self.subcommands.items(): command = command_class(self.stdout, self.stderr) command.style = self.style subparser = subparsers.add_parser( command_name, help=command_class.help ) # This is needed to output console friendly errors subparser.called_from_command_line = self._called_from_command_line command.add_arguments(subparser) subparser.set_defaults(command=command) def execute(self, *args, **options): return options.pop('command').execute(*args, **options)