oioioi.ipdnsauth.management.commands.ipauth-dnsserver
¶
Module Contents¶
Classes¶
Base class for request handler classes. |
|
Base class for request handler classes. |
|
Base class for request handler classes. |
|
Mix-in class to handle each request in a new thread. |
|
Mix-in class to handle each request in a new thread. |
|
The base class from which all management commands ultimately |
Attributes¶
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.BaseRequestHandler(request, client_address, server)[source]¶
Bases:
socketserver.BaseRequestHandler
Base class for request handler classes.
This class is instantiated for each request to be handled. The constructor sets the instance variables request, client_address and server, and then calls the handle() method. To implement a specific service, all you need to do is to derive a class which defines a handle() method.
The handle() method can find the request as self.request, the client address as self.client_address, and the server (in case it needs access to per-server information) as self.server. Since a separate instance is created for each request, the handle() method can define other arbitrary instance variables.
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.TCPRequestHandler(request, client_address, server)[source]¶
Bases:
BaseRequestHandler
Base class for request handler classes.
This class is instantiated for each request to be handled. The constructor sets the instance variables request, client_address and server, and then calls the handle() method. To implement a specific service, all you need to do is to derive a class which defines a handle() method.
The handle() method can find the request as self.request, the client address as self.client_address, and the server (in case it needs access to per-server information) as self.server. Since a separate instance is created for each request, the handle() method can define other arbitrary instance variables.
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.UDPRequestHandler(request, client_address, server)[source]¶
Bases:
BaseRequestHandler
Base class for request handler classes.
This class is instantiated for each request to be handled. The constructor sets the instance variables request, client_address and server, and then calls the handle() method. To implement a specific service, all you need to do is to derive a class which defines a handle() method.
The handle() method can find the request as self.request, the client address as self.client_address, and the server (in case it needs access to per-server information) as self.server. Since a separate instance is created for each request, the handle() method can define other arbitrary instance variables.
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.UDPServer(command, *args, **kwargs)[source]¶
Bases:
socketserver.ThreadingUDPServer
Mix-in class to handle each request in a new thread.
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.TCPServer(command, *args, **kwargs)[source]¶
Bases:
socketserver.ThreadingTCPServer
Mix-in class to handle each request in a new thread.
- class oioioi.ipdnsauth.management.commands.ipauth-dnsserver.Command(*args, **kwargs)[source]¶
Bases:
django.core.management.base.BaseCommand
The base class from which all management commands ultimately derive.
Use this class if you want access to all of the mechanisms which parse the command-line arguments and work out what code to call in response; if you don’t need to change any of that behavior, consider using one of the subclasses defined in this file.
If you are interested in overriding/customizing various aspects of the command-parsing and -execution behavior, the normal flow works as follows:
django-admin
ormanage.py
loads the command class and calls itsrun_from_argv()
method.The
run_from_argv()
method callscreate_parser()
to get anArgumentParser
for the arguments, parses them, performs any environment changes requested by options likepythonpath
, and then calls theexecute()
method, passing the parsed arguments.The
execute()
method attempts to carry out the command by calling thehandle()
method with the parsed arguments; any output produced byhandle()
will be printed to standard output and, if the command is intended to produce a block of SQL statements, will be wrapped inBEGIN
andCOMMIT
.If
handle()
orexecute()
raised any exception (e.g.CommandError
),run_from_argv()
will instead print an error message tostderr
.
Thus, the
handle()
method is typically the starting point for subclasses; many built-in commands and command types either place all of their logic inhandle()
, or perform some additional parsing work inhandle()
and then delegate from it to more specialized methods as needed.Several attributes affect behavior at various steps along the way:
help
A short description of the command, which will be printed in help messages.
output_transaction
A boolean indicating whether the command outputs SQL statements; if
True
, the output will automatically be wrapped withBEGIN;
andCOMMIT;
. Default value isFalse
.requires_migrations_checks
A boolean; if
True
, the command prints a warning if the set of migrations on disk don’t match the migrations in the database.requires_system_checks
A list or tuple of tags, e.g. [Tags.staticfiles, Tags.models]. System checks registered in the chosen tags will be checked for errors prior to executing the command. The value ‘__all__’ can be used to specify that all system checks should be performed. Default value is ‘__all__’.
To validate an individual application’s models rather than all applications’ models, call
self.check(app_configs)
fromhandle()
, whereapp_configs
is the list of application’s configuration provided by the app registry.stealth_options
A tuple of any options the command uses which aren’t defined by the argument parser.