pygnetic / pygame_network /

import logging
import message
import syncobject
import network
import serialization
from handler import Handler
from network import Server, Client

_logger = logging.getLogger(__name__)
register = message.message_factory.register

def init(events=False, event_val=1, logging_lvl=logging.INFO,
         n_module=('enet',), s_module=('msgpack', 'json')):
    """Initialize network library.

    events - allow sending Pygame events (default False)
    event_val - set event ID as event_val + pygame.USEREVENT (default 1)
    logging_lvl - level of logging messages (default logging.INFO, None to skip
                  initializing logging module
    n_module - string or list of strings with names of network
              library adapters, first available will be used
    s_module - string or list of strings with names of serialization
                    library adapters, first available will be used

    Note: Because of the dynamic loading of network library adapter, Client,
        Server and State classes will only be available after initialization.
    global _network_module, _serialization_module
    if logging_lvl is not None:
                            format='%(asctime)-8s %(levelname)-8s %(message)s',
    if network._selected_adapter is not None:"Using %s",
        _logger.critical("Can't find any network module")
    if serialization._selected_adapter is not None:"Using %s",
        _logger.critical("Can't find any serialization module")
    if events:"Enabling pygame events")
        import event
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.