Compare commits
31 Commits
0.9
...
f32c007b3f
Author | SHA1 | Date | |
---|---|---|---|
f32c007b3f | |||
014dc507cc | |||
cec151e564 | |||
26f1caa60e | |||
7092e69e6a | |||
b32bce956f | |||
22bb4e6bd3 | |||
49954d762b | |||
30504239e1 | |||
|
42799296a9 | ||
|
ac54b7cd0d | ||
|
1df2a42196 | ||
|
2909ea7ed4 | ||
|
f55d6c2e19 | ||
|
664b215f16 | ||
|
5fe756ce97 | ||
|
bf28862f1f | ||
|
fe29441d1d | ||
|
d0043f3f18 | ||
|
583997d64c | ||
|
04daf49b0a | ||
|
b19f5d9049 | ||
|
2052bfd2cc | ||
|
418d3e6041 | ||
|
08cd160713 | ||
|
da80bd93d9 | ||
|
61997df1f3 | ||
|
047bb783b7 | ||
|
281bbfdac4 | ||
|
bcd761653f | ||
|
f521992f58 |
166
.drone.yml
166
.drone.yml
@@ -1,166 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: CentOS7_test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
variant: CentOS7
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- python3 setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: CentOS8_test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
variant: CentOS8
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- python3 setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: Ubuntu1804_test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
variant: Ubuntu1804
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- python3 setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: Fedora_test
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
variant: Fedora
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- python3 setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: docker_python:3.6
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
image: python:3.6
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- pip install python-dateutil
|
|
||||||
- python setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: docker_python:latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Run unit test
|
|
||||||
image: python:latest
|
|
||||||
environment:
|
|
||||||
PYTHONPATH: .
|
|
||||||
commands:
|
|
||||||
- pip install python-dateutil
|
|
||||||
- python --version
|
|
||||||
- python setup.py test
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: exec
|
|
||||||
name: Build
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
variant: Fedora
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Build package files
|
|
||||||
commands:
|
|
||||||
- python3 setup.py sdist bdist_wheel
|
|
||||||
|
|
||||||
- name: Versie toevoegen aan download
|
|
||||||
environment:
|
|
||||||
DOWNLOADDIR: /usr/share/nginx/html/download/python/lmwsip
|
|
||||||
commands:
|
|
||||||
- mkdir -p "$${DOWNLOADDIR}"
|
|
||||||
- cd dist
|
|
||||||
- |
|
|
||||||
for f in *
|
|
||||||
do
|
|
||||||
if [ -f "$${DOWNLOADDIR}/$${f}" ]
|
|
||||||
then
|
|
||||||
echo version error
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
cp "$${f}" "$${DOWNLOADDIR}";
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
- ls -l "$${DOWNLOADDIR}"
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- CentOS7_test
|
|
||||||
- CentOS8_test
|
|
||||||
- Ubuntu1804_test
|
|
||||||
- Fedora_test
|
|
||||||
- docker_python:latest
|
|
||||||
- docker_python:3.6
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: installCheck
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: install Check
|
|
||||||
image: python:3.6
|
|
||||||
# Make sure we run the pip installed version
|
|
||||||
commands:
|
|
||||||
- rm -rf lmwsip
|
|
||||||
- pip install --extra-index-url https://marceln.org/download/python lmwsip
|
|
||||||
- python -c "import lmwsip"
|
|
||||||
- python -c "import lmwsip; print(lmwsip.__version__)"
|
|
||||||
- >
|
|
||||||
[ $(python -c "import lmwsip; print(lmwsip.__version__)") =
|
|
||||||
$(python setup.py --version) ]
|
|
||||||
- python -m unittest -v lmwsip.tests
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- Build
|
|
21
.gitea/workflows/build.yml
Normal file
21
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
name: build
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: fedora-builder
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build package
|
||||||
|
run: python3 -m build
|
||||||
|
- name: run tox
|
||||||
|
run: tox
|
||||||
|
- name: Upload na pypi
|
||||||
|
env:
|
||||||
|
TWINE_USERNAME: ${{ secret.PYPI_USER }}
|
||||||
|
TWINE_PASSWORD: ${{ secret.PYPI_PASSWORD }}
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
run: python3 -m twine upload dist/*
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@ lmwsip_marceln.egg-info
|
|||||||
test/__pycache__
|
test/__pycache__
|
||||||
lmwsip.egg-info
|
lmwsip.egg-info
|
||||||
*.swp
|
*.swp
|
||||||
|
.tox
|
||||||
|
@@ -12,12 +12,10 @@ how to use it.
|
|||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
The package is not available on [PyPI](https://pypi.org/).
|
Just install the package with 'pip':
|
||||||
At the moment the package is hosted at https://marceln.org/download/python.
|
|
||||||
|
|
||||||
You can install the package with pip:
|
|
||||||
```
|
```
|
||||||
pip install --extra-index-url https://marceln.org/download/python lmwsip
|
pip install lmwsip
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=$(grep version setup.py | sed -e 's/.*="//' -e 's/",//')
|
yamllint .gitea/workflows/*yml
|
||||||
sed -i "s/^__version__ = .*/__version__ = '${VERSION}'/" lmwsip/__init__.py
|
|
||||||
git add lmwsip/__init__.py
|
|
||||||
|
|
||||||
python setup.py test
|
VERSION=$(grep version setup.cfg | sed 's/.*= *//')
|
||||||
yamllint .drone.yml
|
sed -i "s/^__version__ = .*/__version__ = '${VERSION}'/" src/lmwsip/__init__.py
|
||||||
|
git add src/lmwsip/__init__.py
|
||||||
|
|
||||||
|
tox
|
||||||
|
6
pyproject.toml
Normal file
6
pyproject.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = [
|
||||||
|
"setuptools>=42",
|
||||||
|
"wheel"
|
||||||
|
]
|
||||||
|
build-backend = "setuptools.build_meta"
|
25
setup.cfg
Normal file
25
setup.cfg
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
[metadata]
|
||||||
|
name = lmwsip
|
||||||
|
version = 0.9.6
|
||||||
|
author = Marcel Nijenhof
|
||||||
|
author_email = pypi@marceln.org
|
||||||
|
description = Interface for the lmw sip protocol
|
||||||
|
long_description = file: README.md
|
||||||
|
long_description_content_type = text/markdown
|
||||||
|
url = https://git.marceln.org/Werk/lmwsip
|
||||||
|
classifiers =
|
||||||
|
Programming Language :: Python :: 3
|
||||||
|
License :: OSI Approved :: MIT License
|
||||||
|
Operating System :: OS Independent
|
||||||
|
Development Status :: 4 - Beta
|
||||||
|
|
||||||
|
[options]
|
||||||
|
package_dir =
|
||||||
|
= src
|
||||||
|
install_requires =
|
||||||
|
python-dateutil
|
||||||
|
packages = find:
|
||||||
|
python_requires = >= 3.6
|
||||||
|
|
||||||
|
[options.packages.find]
|
||||||
|
where = src
|
28
setup.py
28
setup.py
@@ -1,26 +1,4 @@
|
|||||||
import setuptools
|
from setuptools import setup
|
||||||
|
|
||||||
with open("README.md", "r") as fh:
|
if __name__ == "__main__":
|
||||||
long_description = fh.read()
|
setup()
|
||||||
|
|
||||||
setuptools.setup(
|
|
||||||
name="lmwsip", # Replace with your own username
|
|
||||||
version="0.9.0",
|
|
||||||
author="Marcel Nijenhof",
|
|
||||||
author_email="pip@marceln.org",
|
|
||||||
description="Interface for the lmw sip protocol",
|
|
||||||
long_description=long_description,
|
|
||||||
long_description_content_type="text/markdown",
|
|
||||||
url="https://marceln.org/git/Werk/lmwsip",
|
|
||||||
packages=setuptools.find_packages(),
|
|
||||||
install_requires=[
|
|
||||||
'python-dateutil'
|
|
||||||
],
|
|
||||||
classifiers=[
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"License :: OSI Approved :: MIT License",
|
|
||||||
"Operating System :: OS Independent",
|
|
||||||
"Topic :: Lmw sip interface"
|
|
||||||
],
|
|
||||||
python_requires='>=3.6',
|
|
||||||
)
|
|
||||||
|
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta
|
|||||||
from dateutil import tz
|
from dateutil import tz
|
||||||
|
|
||||||
""" Version info changed by git hook """
|
""" Version info changed by git hook """
|
||||||
__version__ = '0.9.0'
|
__version__ = '0.9.6'
|
||||||
|
|
||||||
class LmwSip:
|
class LmwSip:
|
||||||
"""Class to connect to the LMW Standard Interface prototcol (sip)
|
"""Class to connect to the LMW Standard Interface prototcol (sip)
|
||||||
@@ -27,7 +27,14 @@ Support for:
|
|||||||
ti
|
ti
|
||||||
cmd(wn, vw, as)
|
cmd(wn, vw, as)
|
||||||
|
|
||||||
|
lmwParameters:
|
||||||
|
|
||||||
|
Overzicht van de lmw parameters
|
||||||
|
- Type: WN, VW, AS
|
||||||
|
- Array size: [1-201]
|
||||||
|
- Periode: 1, 10
|
||||||
"""
|
"""
|
||||||
|
|
||||||
lmwParameters = {
|
lmwParameters = {
|
||||||
'Tm02_MV': ('VW', 1, 0),
|
'Tm02_MV': ('VW', 1, 0),
|
||||||
'xH1': ('WN', 1, 1),
|
'xH1': ('WN', 1, 1),
|
||||||
@@ -489,7 +496,12 @@ Support for:
|
|||||||
'xH60': ('WN', 1, 60),
|
'xH60': ('WN', 1, 60),
|
||||||
'xNI60': ('WN', 1, 60),
|
'xNI60': ('WN', 1, 60),
|
||||||
'xQ60': ('WN', 1, 60),
|
'xQ60': ('WN', 1, 60),
|
||||||
'xH60R': ('WN', 1, 60)
|
'xH60R': ('WN', 1, 60),
|
||||||
|
'QfQStt10': ('WN', 1, 10),
|
||||||
|
'QfQTr10': ('WN', 1, 10),
|
||||||
|
'QfQSt10': ('WN', 1, 10),
|
||||||
|
'QfHYS10': ('WN', 1, 10),
|
||||||
|
'QfQSy10': ('WN', 1, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, user=None, password=None,
|
def __init__(self, user=None, password=None,
|
@@ -4,10 +4,10 @@ import sys
|
|||||||
import io
|
import io
|
||||||
import unittest
|
import unittest
|
||||||
import lmwsip
|
import lmwsip
|
||||||
import lmwsip.tests.stubSipServer
|
import stubSipServer
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from lmwsip.tests.stubSipServer import sipServer
|
from stubSipServer import sipServer
|
||||||
from lmwsip.run import run
|
from lmwsip.run import run
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from dateutil import tz
|
from dateutil import tz
|
Reference in New Issue
Block a user