+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Interface to arnied
only a stub; should at least contain a set_cnf and get_cnf
+
+.. codeauthor:: Intra2net
"""
def set_cnf(var_name, value):
* LogarithmicBuffer: saves only last N items, and after that less and less so
* very few old items are kept
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
class CircularBuffer:
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Helpers for calling commands, capture their output, return result code
Subprocess library just does not provide all the simplicity we would like
Stay python2 compatible --> no timeouts
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from subprocess import Popen, PIPE
#!/bin/bash
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
# check.sh
# check a python file using pylint and pep8
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Helper functions and classes to deal with files and dirs and stuff
Featuring::
.. todo:: change get_filesystem_fill_states to not fork
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
len(my_follower)
Follower(my_file, my_file) # (twice the same)
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Unittest for follow.py
This is a little more involved since in order to test properly, need a second
DEPRECATED
(at least for files see log_read; may still be usefull for pipes/sockets)
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Helper functions with iterators -- functional program is great!
Currently, recipes from python itertools docu (:py:mod:`itertools`) that have
been deemed useful
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from itertools import *
..todo:: do not limit logs by line numbers but by disc size? Warn when at 50%,
75%, 90%, 99% of limit?
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import logging
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Iterative reading of log files
Basic Functionality (class :py:class:`IterativeReader`:)
..todo:: auto-detect log line layout
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import os
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Unittests for log_read
Creates own thread to write data to a log file
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import unittest
-#!/usr/bin/env python
-
# The software in this package is distributed under the GNU General
# Public License version 2 (with a special exception described below).
#
.. note:: You should note this
.. warning:: This is a warning
-.. codeauthor:: John Doe, john.doe@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
"""
raise NotImplementedError()
-
-
-def main():
- """ Main function, called when running file as script
-
- currently raises a NotImplementedError
- """
- raise NotImplementedError
-# end: function main
-
-
-if __name__ == '__main__':
- main()
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" buffer_unittest.py: unit tests for buffers.py
Tests classes and functions in buffers.py
For help see :py:mod:`unittest`
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import unittest
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" call_helper_unittest.py: unit tests for call_helpers
Should be run from python2 and python3!
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import unittest
#!/usr/bin/env python3
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Test test_helpers.DiscFillChecker by actually writing lots of data to disc
Indulge in the luxury of assuming we have python3 here ;-)
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from sys import stderr, argv as cmd_line_args
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" file_helper_unittest.py: unit tests for file_helpers
Tests classes and functions in file_helpers
For help see :py:mod:`unittest`
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import unittest
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" module_name_unittest.py: unit tests for module_name
Tests classes and functions in module_name
For help see :py:mod:`unittest`
-.. codeauthor:: your name, your.name@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" test_helper_unittest.py: unit tests for test_helpers
Tests classes and functions in test_helpers
For help see :py:mod:`unittest`
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" type_helper_unittest.py: unit tests for type_helpers
Tests classes and functions in type_helpers
For help see :py:mod:`unittest`
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
import unittest
+# The software in this package is distributed under the GNU General
+# Public License version 2 (with a special exception described below).
+#
+# A copy of GNU General Public License (GPL) is included in this distribution,
+# in the file COPYING.GPL.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file
+# does not by itself cause the resulting work to be covered
+# by the GNU General Public License.
+#
+# However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based
+# on this file might be covered by the GNU General Public License.
+
""" Helpers for developping quick test scripts
Creation motivated by fear of filling disc space during long-running stress
tests
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function
Provides abstraction from difference between PY2 and PY3
-.. codeauthor:: Christian Herdtweck, christian.herdtweck@intra2net.com
+.. codeauthor:: Intra2net
"""
from __future__ import print_function