Jim Paris
3738430103
Fix flake8 warnings
3 years ago
Jim Paris
a41111b045
Fix some Python 3.8 related issues
3 years ago
Jim Paris
2f2faeeab7
Add pylint config and selectively fix some pylint errors
Some pylint errors are worth fixing; many are not.
4 years ago
Jim Paris
2ed544bd30
Fix flake8-reported code style issues
4 years ago
Jim Paris
d8294469cf
Fix diskusage test coverage
4 years ago
Jim Paris
efbb2665fe
Improve test coverage
4 years ago
Jim Paris
544413018c
Add some thread safety tests
We don't actually use nilmdb.utils.threadsafety.verify_proxy in the
main NilmDB code, but it's useful for finding errors.
It found an issue with __getattr__ in SerializerProxy which
(1) can't be avoided?
(2) is now commented in the code
(3) shouldn't matter in real use
4 years ago
Jim Paris
322b0ec423
Remove impossible error in serializer and test with a C module
4 years ago
Jim Paris
f3833d9b20
Use pip fallocate package rather than hand-rolling
4 years ago
Jim Paris
6624e8dab6
Remove another "no cover"
4 years ago
Jim Paris
d907638858
Remove unnecessary check for private members in serializer
__getattr__ is only called for attributes that don't exist; callers
should never purposely see the private __* symbols, so we don't need
to check for them.
4 years ago
Jim Paris
ba915bb290
Use os.replace instead of os.remove; remove a "no cover"
4 years ago
Jim Paris
f93edc469c
Remove dummy lock functions from lock.py
4 years ago
Jim Paris
087fb39475
Add tests for two more "no cover" blocks
4 years ago
Jim Paris
cadba9fbba
Fix branch coverage
4 years ago
Jim Paris
edf4568e8f
Fix error in interval comparisons; add coverage
4 years ago
Jim Paris
57751f5b32
Consistently use bytes everywhere for stream data
Previous commits went back and forth a bit on whether the various APIs
should use bytes or strings, but bytes appears to be a better answer,
because actual data in streams will always be 7-bit ASCII or raw
binary. There's no reason to apply the performance penalty of
constantly converting between bytes and strings.
One drawback now is that lots of code now has to have "b" prefixes on
strings, especially in tests, which inflates this commit quite a bit.
4 years ago
Jim Paris
1c005518d8
Remove old unicode helpers
4 years ago
Jim Paris
113633459d
Don't wait for thread to exit in __del__
This can hit a deadlock waiting for the thread to exit. We don't
need to wait; it will die when it can, or get terminated when the
interpreter exits.
4 years ago
Jim Paris
fef3e1d31e
Fix various string/bytes issues with Python 3
4 years ago
Jim Paris
b69358a185
Fix error with reraising exceptions in serializer
4 years ago
Jim Paris
5da7e6558e
Fix interval comparisons for Python 3
4 years ago
Jim Paris
1928caa1d7
Use pip version of datetime_tz; fix timestamper test
4 years ago
Jim Paris
5db034432c
Update mustclose and test_mustclose for Python 3 (this was hard!)
4 years ago
Jim Paris
55119a3e07
Port cython and C code to python 3
4 years ago
Jim Paris
a9eff10dbf
Fix 2to3 mistake
4 years ago
Jim Paris
0f5c1c0db6
Run 2to3 automatic fixes over entire tree
4 years ago
Jim Paris
78cfda32e3
Handle another exception from some versions of dateutil.parser
9 years ago
Jim Paris
0a22db3965
Ignore exceptions during __del__ handlers, which may get called during shutdown
10 years ago
Jim Paris
8bb8f068de
Catch harmless error seen in apache logs during shutdown
10 years ago
Jim Paris
06f7390c9e
Fix disk usage block size
10 years ago
Jim Paris
6de77a08f1
Report actual disk size, not apparent size
10 years ago
Jim Paris
bbd59c8b50
Add nilmdb.utils.interval.intersection by generalizing set_difference
10 years ago
Jim Paris
405c110fd7
Doc updates
10 years ago
Jim Paris
6cd28b67b1
Support iterator protocol in Serializer
10 years ago
Jim Paris
d6d215d53d
Improve boolean HTTP parameter handling
10 years ago
Jim Paris
90633413bb
Add nilmdb.utils.interval.human_string function
10 years ago
Jim Paris
c7c3aff0fb
Add nilmdb.utils.interval.optimize function
10 years ago
Jim Paris
9a2699adfc
Attempt at fixing up more Unicode issues with metadata.
11 years ago
Jim Paris
9bbb95b18b
Add unicode decode/encode helpers
11 years ago
Jim Paris
00e6ba1124
Avoid ENOENT in nilmdb.utils.diskusage.du
ENOENT might show up if we're actively deleting files in the nilmdb
thread while trying to read available space from e.g. the server
thread.
11 years ago
Jim Paris
01029230c9
Tweaks to sorting
11 years ago
Jim Paris
23f31c472b
Split sort_streams_nicely into separate file
11 years ago
Jim Paris
230ec72609
Fix timestamp display issues with --annotate
11 years ago
Jim Paris
06038062a2
Fix error in time parsing
11 years ago
Jim Paris
ae9fe89759
Parse timestamps with '@' before any other checks
11 years ago
Jim Paris
f8ca8d31e6
Remove Iteratorizer, as it's no longer needed
11 years ago
Jim Paris
3d24092cd2
Replace bare 'except:' with 'except: Exception'
Otherwise we might inadvertently catch SystemExit or KeyboardExit or
something we don't want to catch.
11 years ago
Jim Paris
c0d450d39e
Add locking mechanism to avoid multiple servers on one DB
11 years ago
Jim Paris
2d72891162
Accept "min" and "max" as timestamps on command line
11 years ago