Initial commit

Signed-off-by: Thomas Klaehn <tkl@blackfinn.de>
This commit is contained in:
Thomas Klaehn 2017-02-15 09:33:38 +01:00
commit e4655c25ae
11 changed files with 129 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.pyc
source/dist/
source/MANIFEST

22
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,22 @@
variables:
# SW_KERNEL: "0"
# SW_MAJOR: "1"
# SW_MINOR: "10"
before_script:
- "echo $CI_BUILD_ID"
- "echo $CI_BUILD_REF_NAME"
stages:
- static_analysis
- test
static_analysis_tests:
stage: static_analysis
script:
- "python pylint_wrapper.py -s src -s tests"
unit_tests:
stage: test
script:
- "python tests/unittest/"

17
.project Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>mqtt_logger</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

10
.pydevproject Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}</path>
<path>/${PROJECT_DIR_NAME}/source</path>
<path>/${PROJECT_DIR_NAME}/tests</path>
</pydev_pathproperty>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
</pydev_project>

1
Readme.md Normal file
View File

@ -0,0 +1 @@
# mqtt data logger

32
pylint_wrapper.py Normal file
View File

@ -0,0 +1,32 @@
'''
Created on Feb 11, 2017
The pylint wrapper is needed for ci because pylint will return != 0 also in
warning case.
@author: tkl
'''
import os
import sys
import getopt
def main(argv):
''' Entry Point for the pylint wrapper. '''
options, _ = getopt.getopt(argv, "s:", ["source="])
source_list = []
for opt, args in options:
if opt in ("-s", "--source"):
source_list.append(args)
source_str = ""
for source in source_list:
source_str += source + " "
os.system("pylint " + source_str)
# pylint for sonar cube
# os.system("pylint " + source_str + \
# " -r n --msg-template=\"{path}:{line}: [{msg_id}({symbol}), " + \
# "{obj}] {msg}\" > sonar.report")
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

2
pylintrc Normal file
View File

@ -0,0 +1,2 @@
[TYPECHECK]
ignored-modules = numpy

14
source/main/__init__.py Normal file
View File

@ -0,0 +1,14 @@
'''
Created on Feb 15, 2017
@author: tkl
'''
import sys
def main():
''' Entry point for the mqtt data logger.
'''
pass
if __name__ == '__main__':
sys.exit(main())

18
source/setup.py Normal file
View File

@ -0,0 +1,18 @@
'''
Created on Feb 15, 2017
Type 'python setup.py sdist' to create the distribution,
type 'python setup.py install' to install the distribution.
@author: tkl
'''
from distutils.core import setup
setup(
name='mqtt_logger',
version='0.1',
author='tkl',
author_email='tkl@blackfinn.de',
url='files.blackfinn.de/python/mqtt_logger-0.1.tar.gz',
packages=['main'],
)

5
tests/__init__.py Normal file
View File

@ -0,0 +1,5 @@
'''
Created on Feb 15, 2017
@author: tkl
'''

View File

@ -0,0 +1,5 @@
'''
Created on Feb 15, 2017
@author: tkl
'''