Skip to content
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

Feature/plc4py #343

Merged
merged 46 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e8eccac
Update README.md
ottlukas Nov 10, 2019
0ea3f91
Merge branch 'develop' of https://github.com/ottlukas/plc4x into develop
ottlukas Jan 5, 2020
70319f5
Update README.md
ottlukas Nov 10, 2019
58cd4a2
Merge branch 'develop' of https://github.com/ottlukas/plc4x into develop
ottlukas Jan 11, 2020
38f2933
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Mar 21, 2020
c24dacd
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Mar 26, 2020
ac4804d
test for spi request class
ottlukas Mar 27, 2020
c9d0ddf
add licence
ottlukas Mar 28, 2020
ee51430
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Apr 3, 2020
226f61d
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas May 18, 2020
4067891
PLC4Py poetry initialization
chrisdutz Aug 13, 2020
c4b0140
Merge pull request #179 from vemmert/feature/plc4py
ottobackwards Aug 20, 2020
511ff3d
pre-commit linting and formatting for python code files using flake8,
ottobackwards Aug 20, 2020
03c4390
Merge pull request #180 from ottobackwards/py-pre-commit
ottobackwards Aug 22, 2020
8622c94
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Sep 11, 2020
a303ec5
add initial class and test
ottobackwards Sep 14, 2020
37d73ce
Merge pull request #187 from ottobackwards/py-init-class-test
ottlukas Sep 14, 2020
3fc25a5
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Sep 20, 2020
e158cbe
Merge branch 'feature/plc4py' of https://github.com/apache/plc4x into…
ottlukas Sep 20, 2020
a3894b6
refactor namespace
ottobackwards Sep 20, 2020
f9ece23
Merge pull request #189 from ottobackwards/namespace-refactor
ottlukas Sep 20, 2020
c00bdad
Merge branch 'feature/plc4py' of https://github.com/apache/plc4x into…
ottlukas Oct 1, 2020
4fd2cef
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Oct 14, 2020
b2fffde
Merge branch 'develop' of https://github.com/apache/plc4x into develop
ottlukas Nov 6, 2020
3e0d5da
Merge branch 'develop' of https://github.com/apache/plc4x into featur…
ottlukas Nov 28, 2020
3f566eb
Merge branch 'develop' of https://github.com/apache/plc4x into featur…
ottlukas Dec 20, 2020
ee06676
add licence
ottlukas Dec 21, 2020
244ee66
add licence
ottlukas Dec 23, 2020
91fd34f
add licence
ottlukas Dec 23, 2020
ac404e7
ignore poetry.lock
ottlukas Dec 23, 2020
d1c6606
Merge pull request #215 from ottlukas/feature/plc4py
ottlukas Dec 23, 2020
6526432
update pyproject.toml and poetry.lock
ottlukas Dec 23, 2020
d4f7940
Merge pull request #216 from ottlukas/feature/plc4py
ottlukas Dec 23, 2020
1bde1c8
exclude lock file
ottlukas Jan 6, 2021
7c714f3
Merge pull request #218 from ottlukas/feature/plc4py
ottlukas Jan 6, 2021
fbe2e0d
Merge branch 'develop' of https://github.com/apache/plc4x into featur…
ottlukas Jan 6, 2021
2f6032e
Merge branch 'develop' into feature/plc4py
ottlukas Jan 6, 2021
01fe83a
PLC4Py maven integration
vemmert Jan 8, 2021
a7d8327
PLC4Py maven integration
vemmert Jan 8, 2021
cab0332
PLC4Py maven integration
vemmert Jan 8, 2021
76b0401
PLC4Py maven integration
vemmert Jan 8, 2021
5149731
Merge pull request #220 from vemmert/feature/plc4py
ottlukas Jan 12, 2021
c054673
Merge branch 'develop' into feature/plc4py
sruehl Apr 10, 2021
0465cd1
Merge branch 'develop' into feature/plc4py
hutcheb Apr 9, 2022
29643f3
Update RAT check for mypy and pytest cache folders
hutcheb Apr 9, 2022
c337528
Remove old files
hutcheb Apr 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@
<exclude>**/.git/**</exclude>
<exclude>**/.gitignore</exclude>
<exclude>**/cmake-*/**</exclude>
<exclude>**/.lock/**</exclude>
<exclude>**/.cmake/**</exclude>
<!-- License Files for other licenses -->
<exclude>**/UNLICENSE</exclude>
Expand Down Expand Up @@ -846,6 +847,10 @@
<!-- Temporary Python virtualenv files-->
<exclude>**/venv/**</exclude>

<!-- Temporary pytest and mypy folders -->
<exclude>**/.mypy_cache/**</exclude>
<exclude>**/.pytest_cache/**</exclude>

<!-- Exclude a temp file needed by Docker -->
<exclude>project_version</exclude>

Expand Down
168 changes: 168 additions & 0 deletions sandbox/plc4py/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Created by .ignore support plugin (hsz.mobi)
### Python template
# 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

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/

/poetry.lock
52 changes: 52 additions & 0 deletions sandbox/plc4py/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# NOTE: This configuration runs on the entire repository
# So, the types: should be set accordingly
# Right now we only run this on python, and this configuration
# is in the plc4py directory.default_language_version:
# If we were to use this for hooks across the whole project we
# should configure this at the top level
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
types: [python]
- id: end-of-file-fixer
types: [python]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8
types: [python]
- repo: https://github.com/psf/black
rev: 19.10b0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6
types: [python]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
hooks:
- id: mypy
types: [python]
43 changes: 0 additions & 43 deletions sandbox/plc4py/README.md

This file was deleted.

43 changes: 43 additions & 0 deletions sandbox/plc4py/plc4py/PlcDriverManager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
from contextlib import contextmanager

from plc4py.api.PlcConnection import PlcConnection


class PlcDriverManager:

def __init__(self):
pass

@contextmanager
def connection(self, url: str) -> PlcConnection:
"""
Context manager to handle connection.
"""
conn = None
try:
conn = self.get_connection(url)
yield conn
finally:
if conn is not None:
conn.close()

def get_connection(self, url: str) -> PlcConnection:
pass
20 changes: 20 additions & 0 deletions sandbox/plc4py/plc4py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

__version__ = "0.1.0"
31 changes: 31 additions & 0 deletions sandbox/plc4py/plc4py/api/PlcConnection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

class PlcConnection:
def __init__(self):
print('init method called')

def __enter__(self):
return self

def __exit__(self, *args):
pass

def close(self) -> None:
pass