-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webserver_logger example, and shutdown events #35
base: master
Are you sure you want to change the base?
Changes from all commits
f0dd1e0
1db63bb
f808ea9
e3e5fc4
cc99df8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,166 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# pdm | ||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
#pdm.lock | ||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
# in version control. | ||
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control | ||
.pdm.toml | ||
.pdm-python | ||
.pdm-build/ | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
dist/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# PyCharm | ||
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can | ||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
# and can be added to the global gitignore or merged into this file. For a more nuclear | ||
# option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
#.idea/ | ||
|
||
# Ignore SSL keys | ||
*.pem | ||
*.p12 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like it's your test script, which should not have been committed to the repo. |
||
version=0.3.4 | ||
poetry build | ||
sudo pip install --force-reinstall dist/radiacode-${version}-py3-none-any.whl |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
name = "radiacode" | ||
version = "0.3.3" | ||
description = "Library for RadiaCode-101" | ||
version = "0.3.4" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current release pipeline includes setting an annotated tag and pushing to GitHub to build a pip package with GitHub Actions. |
||
description = "Library for RadiaCode-10x" | ||
authors = ["Maxim Andreev <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
|
@@ -11,7 +11,10 @@ classifiers = [ | |
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
] | ||
include = ["radiacode-examples/*"] | ||
packages = [ | ||
{ include = "radiacode" }, | ||
{ include = "radiacode_examples" } | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
|
@@ -30,6 +33,14 @@ mypy = "^1.7" | |
[tool.poetry.extras] | ||
examples = ["aiohttp", "prometheus-client", "matplotlib", "numpy", "pyyaml"] | ||
|
||
[tool.poetry.scripts] | ||
radiacode_basic = "radiacode_examples.basic:main" | ||
radiacode_exporter = "radiacode_examples.radiacode_exporter:main" | ||
radiacode_show_spectrum = "radiacode_examples.show_spectrum:main" | ||
radiacode_webserver = "radiacode_examples.webserver:main" | ||
radiacode_webserver_logger = "radiacode_examples.webserver_logger:main" | ||
radiacode_narodmon = "radiacode_examples.narodmon:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
@@ -46,4 +57,4 @@ inline-quotes = "single" | |
quote-style = "single" | ||
|
||
[tool.ruff.per-file-ignores] | ||
"__init__.py" = ["F401", "F403"] | ||
"__init__.py" = ["F401", "F403"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
RadiaCode Examples | ||
|
||
This package contains example scripts for using the RadiaCode library. | ||
|
||
Available examples: | ||
- basic: A simple command-line interface for RadiaCode | ||
- show_spectrum: Reads spectrum data from Radiacode 102 device, displays and | ||
stores the count rate history and the spectrum of deposited energies. | ||
- webserver: A web-based interface for RadiaCode data | ||
- webserver_logger: ...with rotating file logging | ||
- radiacode_exporter: Stores radiacode data in a Prometheus database | ||
- narodmon: Script for sending data to the narodmon.ru monitoring project | ||
|
||
To run an example, use: | ||
python -m radiacode_examples.<example_name> | ||
|
||
For instance: | ||
python -m radiacode_examples.webserver | ||
""" | ||
|
||
__all__ = ['basic', 'show_spectrum', 'webserver', 'webserver_logger', 'radiacode_exporter', 'narodmon'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add only related records or revert this file.