| 1 | #+OPTIONS: ^:nil
|
|---|
| 2 |
|
|---|
| 3 | * AmmosReader
|
|---|
| 4 |
|
|---|
| 5 | Project containing necessary File- or SocketStream-Reader to read the various datastreams of Ammos
|
|---|
| 6 |
|
|---|
| 7 | * Installation
|
|---|
| 8 |
|
|---|
| 9 | ** Standard pip install (not tested on all platforms)
|
|---|
| 10 |
|
|---|
| 11 | #+BEGIN_SRC shell
|
|---|
| 12 | git clone http://gitlab.kid.local/kidzg/ammosreader.git
|
|---|
| 13 | cd ammosreader
|
|---|
| 14 | python3 -m pip install .
|
|---|
| 15 | #+END_SRC
|
|---|
| 16 |
|
|---|
| 17 | ** Using the guix functional package manager
|
|---|
| 18 |
|
|---|
| 19 | First subscribe to the GUIX oai channel (see Chapter Add channel to system) in
|
|---|
| 20 | https://gitlab.kid.local/kidzg/guix-deployment/-/blob/master/DevOps.org)
|
|---|
| 21 |
|
|---|
| 22 | Then install using the guix
|
|---|
| 23 |
|
|---|
| 24 | #+BEGIN_SRC shell
|
|---|
| 25 | guix package -i python-ammosreader
|
|---|
| 26 | #+END_SRC
|
|---|
| 27 |
|
|---|
| 28 | * Usage
|
|---|
| 29 |
|
|---|
| 30 | There are two scripts, which demonstrate the usage of the ammosreader package.
|
|---|
| 31 |
|
|---|
| 32 | ** iqdw_reader.py
|
|---|
| 33 |
|
|---|
| 34 | #+BEGIN_SRC shell
|
|---|
| 35 | python3 iqdw_reader.py 'path_to_iqdw_file'
|
|---|
| 36 | #+END_SRC
|
|---|
| 37 |
|
|---|
| 38 | ** pdw_reader.py
|
|---|
| 39 |
|
|---|
| 40 | #+BEGIN_SRC shell
|
|---|
| 41 | python3 pdw_reader.py 'path_to_pdw_file'
|
|---|
| 42 | #+END_SRC
|
|---|
| 43 |
|
|---|
| 44 | To minimize depencencies of the core package other scripts (audio_reader, ammos_viewer)
|
|---|
| 45 | are now stored in separate packages.
|
|---|
| 46 |
|
|---|
| 47 | * Logging
|
|---|
| 48 |
|
|---|
| 49 | If you use ammosreader in your own scripts a logger can be imported and used as follows:
|
|---|
| 50 |
|
|---|
| 51 | #+BEGIN_SRC python
|
|---|
| 52 | from ammosreader import logger
|
|---|
| 53 | logger.warning("Put your warning here")
|
|---|
| 54 | #+END_SRC
|
|---|
| 55 |
|
|---|
| 56 | ** Log-File
|
|---|
| 57 |
|
|---|
| 58 | The name of the logfile is ammos.log
|
|---|
| 59 | The logger uses the directory stored in the AMMOS_LOG_DIR environment variable.
|
|---|
| 60 | If this variable is not set, /tmp is used as default. This might change to /var/log/
|
|---|
| 61 | in future versions running under GUIX system.
|
|---|
| 62 | If the logfile is not writable, the standard logger config is used and
|
|---|
| 63 | the logs go directly to console (tty).
|
|---|
| 64 | (see ammos_logging.conf file in this repository)
|
|---|
| 65 |
|
|---|
| 66 | ** Log-Level
|
|---|
| 67 |
|
|---|
| 68 | You can change the log-Level by setting the environment variable AMMOS_LOG_LEVEL.
|
|---|
| 69 | To turn off logging completely set the level to 'CRITICAL'
|
|---|
| 70 |
|
|---|
| 71 | #+BEGIN_SRC shell
|
|---|
| 72 | export AMMOS_LOG_LEVEL=CRITICAL
|
|---|
| 73 | #+END_SRC
|
|---|
| 74 |
|
|---|
| 75 | If the environment variable does not exist, the logging level from ammos_logging.conf is used.
|
|---|