pyi2ncommon
5 years agoMerge branch 'install-subdir' v1.2
Christian Herdtweck [Tue, 22 May 2018 10:56:17 +0000]
Merge branch 'install-subdir'

5 years agoSkip CnfVar unittests
Christian Herdtweck [Tue, 22 May 2018 10:33:30 +0000]
Skip CnfVar unittests

These tests seem to never have worked

5 years agoClarify that disc_filler is no unittest
Christian Herdtweck [Tue, 22 May 2018 10:11:34 +0000]
Clarify that disc_filler is no unittest

5 years agoReplace non-ascii char in cnfvar, import print from future
Christian Herdtweck [Tue, 22 May 2018 10:11:18 +0000]
Replace non-ascii char in cnfvar, import print from future

5 years agoRename cnfvar unittest so it is actually being found and used
Christian Herdtweck [Tue, 22 May 2018 10:07:42 +0000]
Rename cnfvar unittest so it is actually being found and used

5 years agoMake all internal imports relative
Christian Herdtweck [Tue, 22 May 2018 09:58:50 +0000]
Make all internal imports relative

5 years agoRemove test code from zip_stream module, add comments
Christian Herdtweck [Tue, 22 May 2018 09:51:14 +0000]
Remove test code from zip_stream module, add comments

5 years agoIncrease version to 1.2
Christian Herdtweck [Tue, 22 May 2018 09:34:55 +0000]
Increase version to 1.2

5 years agoInstall into subdir pyi2ncommon in site-packages
Christian Herdtweck [Tue, 22 May 2018 09:34:42 +0000]
Install into subdir pyi2ncommon in site-packages

Before, all files src/*.py were just copied to /usr/lib/pythonX.X/site-packages

5 years agoMove template for tests to template dir
Christian Herdtweck [Tue, 22 May 2018 10:09:07 +0000]
Move template for tests to template dir

5 years agoMerge branch 'zip-stream'
Christian Herdtweck [Tue, 22 May 2018 10:34:53 +0000]
Merge branch 'zip-stream'

5 years agoCreate template subdir, move template there
Christian Herdtweck [Tue, 22 May 2018 09:33:44 +0000]
Create template subdir, move template there

Could otherwise not get template.py out of installed code

5 years agoAdd a TODO to track current development directions.
Plamen Dimitrov [Mon, 12 Sep 2016 15:08:13 +0000]
Add a TODO to track current development directions.

5 years agoCreate a streamable version of ZipFile
Christian Herdtweck [Fri, 18 May 2018 13:57:04 +0000]
Create a streamable version of ZipFile

Python's ZipFile requires data in memory or on disc in order to compress it.
This module contains class ZipStream that extends ZipFile to allow read-only,
non-seekable streams as input.

For python < 3.5 this requires python-zipfile35; implementation is MUCH simpler
for python >= 3.6

6 years agoDo not color output to non-terminal; improve print() arg handling
Christian Herdtweck [Fri, 2 Feb 2018 12:58:42 +0000]
Do not color output to non-terminal; improve print() arg handling

6 years agoHandle missing parameters to log string
Christian Herdtweck [Thu, 14 Dec 2017 10:45:37 +0000]
Handle missing parameters to log string

6 years agoMore output from test to simplify debugging; set thresh back to 1s
Christian Herdtweck [Wed, 6 Dec 2017 12:20:51 +0000]
More output from test to simplify debugging; set thresh back to 1s

6 years agoUse a monotonic wall clock for performance tests also in py2
Christian Herdtweck [Wed, 6 Dec 2017 12:16:01 +0000]
Use a monotonic wall clock for performance tests also in py2

This fixes the problem enountered sometimes in unittest test_log_read. The
clock was not precise enough (10ms beat)

6 years agoMake src and test a package by adding __init__.py
Christian Herdtweck [Wed, 6 Dec 2017 12:15:12 +0000]
Make src and test a package by adding __init__.py

6 years agoMake sure unittests only import from src
Christian Herdtweck [Wed, 6 Dec 2017 12:14:51 +0000]
Make sure unittests only import from src

Before, the imports could have been from an earlier installed version of
pyi2ncommon.

6 years agoSkip unittest that fails when building rpm
Christian Herdtweck [Wed, 6 Dec 2017 09:46:32 +0000]
Skip unittest that fails when building rpm

Test succeeds if running unittests on shell, but fails when building rpm.
For some reason there is an extra thread that behaves unexpected.

6 years agoMerge branch 'cnfvar-py'
Christian Herdtweck [Fri, 1 Dec 2017 15:33:05 +0000]
Merge branch 'cnfvar-py'

6 years agoChange version to 1.1
Christian Herdtweck [Fri, 1 Dec 2017 15:27:06 +0000]
Change version to 1.1

6 years agoBe more generous with reading delay in unittest
Christian Herdtweck [Fri, 1 Dec 2017 15:26:55 +0000]
Be more generous with reading delay in unittest

6 years agoMake compatible again with py2
Christian Herdtweck [Fri, 1 Dec 2017 15:26:34 +0000]
Make compatible again with py2

6 years agoBuild dist with py3
Christian Herdtweck [Fri, 1 Dec 2017 15:25:59 +0000]
Build dist with py3

6 years agouse string type for writing to stdout
Philipp Gesang [Fri, 1 Dec 2017 15:14:56 +0000]
use string type for writing to stdout

6 years agoimprove description of cnfvar.py command line usage
Philipp Gesang [Fri, 1 Dec 2017 11:40:05 +0000]
improve description of cnfvar.py command line usage

Try it out:

    $ ssh some-intranator '/usr/intranator/bin/get_cnf' |python3 src/cnfvar.py -

6 years agoadapt cnfvar stdout writer for python3
Philipp Gesang [Fri, 1 Dec 2017 11:33:11 +0000]
adapt cnfvar stdout writer for python3

stdio output still trips over the bytes / string separation. Fix
it by defaulting to bytes which mirrors the reader. Add optional
string writer for use with direct text output.

6 years agotest for toplevel line after popping nested var
Philipp Gesang [Fri, 1 Dec 2017 11:16:34 +0000]
test for toplevel line after popping nested var

After reaching the end of a sequence of CNF siblings at nesting
level > 1, the parser crashes because the updated current line
is a toplevel line:

    234  FIREWALL_NETGROUP,1: "i2n"
    235     (234) FIREWALL_NETGROUP_NETWORK,0: ""
    236        (235) FIREWALL_NETGROUP_NETWORK_IP,0: "172.16.1.0"
    237        (235) FIREWALL_NETGROUP_NETWORK_NETMASK,0: "255.255.255.0"
    238  FIREWALL_NETGROUP,2: "drift-extern" # <----------------------------------- boom!
    239     (238) FIREWALL_NETGROUP_NETWORK,0: "drift"
    240        (239) FIREWALL_NETGROUP_NETWORK_IP,0: "172.16.1.85"
    241        (239) FIREWALL_NETGROUP_NETWORK_NETMASK,0: "255.255.255.255"

Fix by testing for parent lines and exiting immediately.

6 years agofix stdio processing in cnfvar.py
Philipp Gesang [Fri, 1 Dec 2017 10:57:50 +0000]
fix stdio processing in cnfvar.py

Data not supplied from the Python end still suffers from encoding
issues, so fix those.

6 years agoextend cnfvar.py description
Philipp Gesang [Fri, 1 Dec 2017 10:40:29 +0000]
extend cnfvar.py description

Also amend the formatting that got distorted by autopep8 in
Autotest.

6 years agoadd license blurb to cnfvar files
Philipp Gesang [Fri, 1 Dec 2017 10:15:20 +0000]
add license blurb to cnfvar files

All repo files are under GPLv2+ with linking exception.

6 years agoupdate cnfvar unittest for python 3
Philipp Gesang [Fri, 1 Dec 2017 10:12:22 +0000]
update cnfvar unittest for python 3

6 years agoimport cnfvar and unit tests
Philipp Gesang [Fri, 1 Dec 2017 10:08:39 +0000]
import cnfvar and unit tests

cnfvar.py          <- intranator/backup-crypto
cnfvar_unittest.py <- autotest-intranator/backup-crypto

Consequently, cnfvar.py has already been adapted for Python 3,
the unit tests have not.

7 years agoRename shortened to head_and_tail
Christian Herdtweck [Wed, 7 Dec 2016 15:10:10 +0000]
Rename shortened to head_and_tail

7 years agoCreate unittest for shortened(...)
Christian Herdtweck [Wed, 7 Dec 2016 10:21:56 +0000]
Create unittest for shortened(...)

7 years agoCreate text_helper shortened(...)
Christian Herdtweck [Wed, 7 Dec 2016 10:21:47 +0000]
Create text_helper shortened(...)

7 years agoFix unittests for color output functions
Christian Herdtweck [Wed, 7 Dec 2016 10:21:32 +0000]
Fix unittests for color output functions

7 years agoMake text_helpers py2-compatible
Christian Herdtweck [Wed, 7 Dec 2016 10:21:08 +0000]
Make text_helpers py2-compatible

7 years agoMore error handling in log_read
Christian Herdtweck [Wed, 7 Dec 2016 10:20:39 +0000]
More error handling in log_read

7 years agoAdd unittest for new text_helpers.
Christian Herdtweck [Fri, 7 Oct 2016 14:22:59 +0000]
Add unittest for new text_helpers.

Can only test whether functions raise an error since correct behaviour is
hard to test automatically.

7 years agoCreate text_helpers with color/style functions for output
Christian Herdtweck [Fri, 7 Oct 2016 14:21:34 +0000]
Create text_helpers with color/style functions for output

7 years agoUpdate unittest template and skip one test
Christian Herdtweck [Fri, 7 Oct 2016 14:21:00 +0000]
Update unittest template and skip one test

7 years agoIgnore automatically created api doc files
Christian Herdtweck [Fri, 7 Oct 2016 14:19:30 +0000]
Ignore automatically created api doc files

7 years agoremove warning that is triggered quite often and purely informal
Christian Herdtweck [Wed, 29 Jun 2016 15:08:14 +0000]
remove warning that is triggered quite often and purely informal

7 years agoremove whitespace
Christian Herdtweck [Wed, 29 Jun 2016 15:07:10 +0000]
remove whitespace

7 years agocreated simple LogParser
Christian Herdtweck [Wed, 29 Jun 2016 15:06:59 +0000]
created simple LogParser

7 years agofix typo in docu and extend a little
Christian Herdtweck [Wed, 29 Jun 2016 15:05:55 +0000]
fix typo in docu and extend a little

7 years agoimprove docu
Christian Herdtweck [Wed, 29 Jun 2016 15:04:59 +0000]
improve docu

7 years agoensure NOTICE log level is always int
Christian Herdtweck [Wed, 29 Jun 2016 15:04:29 +0000]
ensure NOTICE log level is always int

7 years agoadd I2nLogger.exception
Christian Herdtweck [Wed, 29 Jun 2016 15:04:02 +0000]
add I2nLogger.exception

7 years agodeal with level given as string in I2nLogger.log or constructor
Christian Herdtweck [Wed, 29 Jun 2016 15:03:43 +0000]
deal with level given as string in I2nLogger.log or constructor

7 years agoremoved param max_lines from I2nLogger: more trouble that it is worth
Christian Herdtweck [Wed, 29 Jun 2016 15:02:08 +0000]
removed param max_lines from I2nLogger: more trouble that it is worth

7 years agocopied function is_glob that I created for oletools
Christian Herdtweck [Wed, 29 Jun 2016 15:00:13 +0000]
copied function is_glob that I created for oletools

8 years agofix sphinx todo/seealso flags
Christian Herdtweck [Fri, 12 Feb 2016 14:00:15 +0000]
fix sphinx todo/seealso flags

8 years agochange argument order since I used paths as only arg for the x-th time
Christian Herdtweck [Fri, 12 Feb 2016 08:46:40 +0000]
change argument order since I used paths as only arg for the x-th time

8 years agoin case there are multiple mounts for same path, prefer REAL_FILESYSTEM_TYPE
Christian Herdtweck [Fri, 12 Feb 2016 08:45:47 +0000]
in case there are multiple mounts for same path, prefer REAL_FILESYSTEM_TYPE

8 years agore-introduce blacklist since fstype not always known
Christian Herdtweck [Fri, 12 Feb 2016 08:45:14 +0000]
re-introduce blacklist since fstype not always known

8 years agoreplaced blacklist NOT_REAL_FILESYSTEMS with whitelist REAL_FILESYSTEMS
Christian Herdtweck [Fri, 12 Feb 2016 08:17:47 +0000]
replaced blacklist NOT_REAL_FILESYSTEMS with whitelist REAL_FILESYSTEMS

8 years agomake sizes in test_helpers readable
Christian Herdtweck [Fri, 5 Feb 2016 10:29:19 +0000]
make sizes in test_helpers readable

8 years agoalso deal with differences in size_str
Christian Herdtweck [Fri, 5 Feb 2016 10:27:13 +0000]
also deal with differences in size_str

8 years agomake sizes more readable with function file_helpers.size_str
Christian Herdtweck [Fri, 5 Feb 2016 10:16:40 +0000]
make sizes more readable with function file_helpers.size_str

8 years agocreate shell script to run unittests
Christian Herdtweck [Fri, 5 Feb 2016 10:15:33 +0000]
create shell script to run unittests

8 years agoget unittests run again
Christian Herdtweck [Fri, 5 Feb 2016 10:15:13 +0000]
get unittests run again

8 years agocleaner way to sort out unwanted file system info: bool flag
Christian Herdtweck [Fri, 5 Feb 2016 10:14:09 +0000]
cleaner way to sort out unwanted file system info: bool flag

8 years agocreated watch_disc_fill to monitor disc fill of other programs
Christian Herdtweck [Thu, 4 Feb 2016 13:54:00 +0000]
created watch_disc_fill to monitor disc fill of other programs

8 years agocreate new file_helpers.get_mount_info
Christian Herdtweck [Thu, 4 Feb 2016 13:47:44 +0000]
create new file_helpers.get_mount_info

8 years agocompleted testing the non-forking filesystem state, use as default now
Christian Herdtweck [Thu, 4 Feb 2016 11:24:43 +0000]
completed testing the non-forking filesystem state, use as default now

8 years agoimplement non-forking way to get all filesystem's fill state (/proc/mounts + statvfs)
Christian Herdtweck [Thu, 21 Jan 2016 16:55:21 +0000]
implement non-forking way to get all filesystem's fill state (/proc/mounts + statvfs)

does not quite give the same result as df (yet?)

8 years agore-enable unittests in spec file, skip individual tests
Christian Herdtweck [Fri, 15 Jan 2016 14:45:34 +0000]
re-enable unittests in spec file, skip individual tests

8 years agofix unittest compatibility issues
Christian Herdtweck [Fri, 15 Jan 2016 14:45:14 +0000]
fix unittest compatibility issues

added iter_helpers.[i]zip_longest
added test_helpers.get_perf_counter

8 years agoupdated README
Christian Herdtweck [Fri, 15 Jan 2016 14:02:08 +0000]
updated README

8 years agocreate make_dist.sh script that creates and modifies spec file and source tar.gz
Christian Herdtweck [Fri, 15 Jan 2016 10:30:50 +0000]
create make_dist.sh script that creates and modifies spec file and source tar.gz

8 years agodo not package docu/tests into pyi2ncommon (get installed into /usr)
Christian Herdtweck [Fri, 15 Jan 2016 10:26:50 +0000]
do not package docu/tests into pyi2ncommon (get installed into /usr)

8 years agoadded README
Christian Herdtweck [Thu, 14 Jan 2016 17:08:35 +0000]
added README

8 years agocreated a setup.py following distutils instructions from https://docs.python.org...
Christian Herdtweck [Thu, 14 Jan 2016 16:54:07 +0000]
created a setup.py following distutils instructions from https://docs.python.org/3.3/distutils/index.html

8 years agorenamed unittests from test/module_unittest.py to test/test_module.py
Christian Herdtweck [Thu, 14 Jan 2016 16:54:02 +0000]
renamed unittests from test/module_unittest.py to test/test_module.py

8 years agomoved python files from root dir into new src subdir
Christian Herdtweck [Thu, 14 Jan 2016 16:18:11 +0000]
moved python files from root dir into new src subdir

as recommended in distutils docu

8 years agomoved old unittests into test subdir
Christian Herdtweck [Thu, 14 Jan 2016 15:54:46 +0000]
moved old unittests into test subdir

8 years agouups
Christian Herdtweck [Thu, 14 Jan 2016 15:17:03 +0000]
uups

8 years agoupdated doc
Christian Herdtweck [Thu, 14 Jan 2016 15:01:34 +0000]
updated doc

8 years agoadd license to every source file and replaced codeauthor with Intra2net
Christian Herdtweck [Thu, 14 Jan 2016 14:32:44 +0000]
add license to every source file and replaced codeauthor with Intra2net

8 years agotest completed successfully (/dev/random was too slow)
Christian Herdtweck [Thu, 14 Jan 2016 14:16:13 +0000]
test completed successfully (/dev/random was too slow)

8 years agochange unit of FilesystemFillState to bytes since that was assumed in other code
Christian Herdtweck [Thu, 14 Jan 2016 14:15:04 +0000]
change unit of FilesystemFillState to bytes since that was assumed in other code

8 years agofix a bug in text-parsing; clean up imports
Christian Herdtweck [Thu, 14 Jan 2016 14:03:28 +0000]
fix a bug in text-parsing; clean up imports

8 years agoadded comments and todos
Christian Herdtweck [Thu, 14 Jan 2016 14:02:49 +0000]
added comments and todos

8 years agocreated test that actually writes data to a filesystem to really test disc_fill_checked
Christian Herdtweck [Thu, 14 Jan 2016 14:02:08 +0000]
created test that actually writes data to a filesystem to really test disc_fill_checked

8 years agonew test, new bugs found...
Christian Herdtweck [Thu, 14 Jan 2016 14:01:39 +0000]
new test, new bugs found...

8 years agocreate iter_helpers since pairwise now used multiple times
Christian Herdtweck [Thu, 14 Jan 2016 14:00:47 +0000]
create iter_helpers since pairwise now used multiple times

8 years agodisc checker thread works now in unittests
Christian Herdtweck [Thu, 14 Jan 2016 13:05:59 +0000]
disc checker thread works now in unittests

added alternativ implementation using alarms (untested)

8 years agoadded a todo and forgotten 'self's
Christian Herdtweck [Thu, 14 Jan 2016 13:04:32 +0000]
added a todo and forgotten 'self's

8 years agosome bugfixes: ignore tmpfs in disc fill check, set daemon compatibly
Christian Herdtweck [Wed, 13 Jan 2016 17:13:42 +0000]
some bugfixes: ignore tmpfs in disc fill check, set daemon compatibly

8 years agofix typos
Christian Herdtweck [Wed, 13 Jan 2016 17:10:12 +0000]
fix typos

8 years agostart testing the DiscCheckerThread, not as easy as expected...
Christian Herdtweck [Wed, 13 Jan 2016 17:09:24 +0000]
start testing the DiscCheckerThread, not as easy as expected...

8 years agocontinue testing and correcting disc-usage checker; decision function and zero-estima...
Christian Herdtweck [Wed, 13 Jan 2016 16:14:13 +0000]
continue testing and correcting disc-usage checker; decision function and zero-estimation correct

8 years agotest creation and str-formatting of FilesystemFillState since I once stumbled over...
Christian Herdtweck [Wed, 13 Jan 2016 16:12:48 +0000]
test creation and str-formatting of FilesystemFillState since I once stumbled over this

8 years agoadd from __future__ import print_function for compatibility in templates
Christian Herdtweck [Wed, 13 Jan 2016 16:12:18 +0000]
add from __future__ import print_function for compatibility in templates

8 years agoclarified names around df-wrappers: include "fill" in function and class
Christian Herdtweck [Wed, 13 Jan 2016 16:11:17 +0000]
clarified names around df-wrappers: include "fill" in function and class

8 years agoimplemented robust estimation of time-until-disc-full
Christian Herdtweck [Wed, 13 Jan 2016 11:14:52 +0000]
implemented robust estimation of time-until-disc-full