The base structure

The structure of the project is the classical structure of a minimal Python package:

/audio-encode-server
/audio_encode_server
/__init__.py
/server.py
/encoder.py
/script
/audio-encode-server
/config.sample.json
/README.rst
/setup.py

The name of the package is audio-encode-server. The name of the package is the name that is used when installing a Python package from pip. In this directory, there is the top-level module of the package: audio_encode_server. The name is the same as the package but with underscores instead of minus characters, because module names cannot contain minus characters in their names. In this directory, there are several Python files, one for each feature of the server. In this first implementation, only two files are needed:

  • One to implement the server itself
  • Another one to implement the encoder driver

The script directory contains the scripts to install with the package. Here, there is only one shell script that is used to start the daemon. Then, there is a sample configuration file that can be used as-is:

  • The server listens on localhost
  • The server listens on port 8080
  • The server stores files in /tmp

There is also a README file in reStructuredText format, the format used to write Python documentation (with the sphinx tool). Finally, the setup.py file allows us to install this package with the setup tools. It contains information such as the name of the package, the scripts to install, and the dependencies of the package.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.189.67