Services
========

This directory contains services that will be used within sugar-server.

Each service might contain the following access points.

- File `etc.py`
  - If service needs configuration parameters, this file should contain
    `sugar_server.util.Option` per each option
  - If service needs subcommands, this file should contain
    `sugar_server.util.Command` per each command
- File `service.py`
  - `setup()`, required
    setup service before calling any other service functions
  - `start()`, required
    start service
  - `stop()`, required
    stop service
  - `import_root(src_root_path)`, required
    import data from another sugar-server installation
  - `import_xs(src_root_path)`, required
    import data from XS installation
  - `CMD_<command-name>()`
    for all commands from `etc.py` file
  - `GET_<url-path>()`, optional
    will be called to process `<url-path>` HTTP GET requests
  - `POST_<url-path>()`, optional
    will be called to process `<url-path>` HTTP POST requests

Service python modules are not included to the global sugar_server python
package to avoid cross-services imports and service directory won't be included
to sys.path list. To import service modules from service code itself, use
util.service_import() function and see examples in existed services.
