Athanasius
fa1443b49c
Contributing.md: Document use of logging.
...
Also fixes some camelCase to be proper snake_case in an example.
2020-07-27 06:57:23 +01:00
Athanasius
c971106c0e
Convert print()s to logging & refactor help_about -> HelpAbout
2020-07-27 06:57:23 +01:00
Athanasius
cd4216d19c
logger setup and initialisation
...
* Initial printing of version is now a logger.info(...)
2020-07-26 23:16:52 +01:00
Athanasius
e1752506c5
Move "only run once" code into def enforce_single_instance()
2020-07-26 23:16:52 +01:00
A_D
5aaf88b281
fix quoting style
2020-07-26 23:08:47 +01:00
A_D
87b7f639bb
cleanup coriolis.py
2020-07-26 23:08:47 +01:00
A_D
f08d60d9b1
revert using json.dump
...
windows encodings dont like the weird characters
2020-07-26 23:08:47 +01:00
A_D
0e0c802b04
Fixed missed whitespace after scope changes
2020-07-26 23:08:47 +01:00
A_D
64b9cb39a9
Replaced file.write(json.dumps()) with json.dump
...
There's no reason to use json.dumps and directly encode it when we can
let the json lib do the heavy lifting
2020-07-26 23:08:47 +01:00
A_D
566f52e61f
removed uneeded parens
2020-07-26 23:08:47 +01:00
A_D
14295ce9e8
Fixed scope whitespace and long lines
2020-07-26 23:08:47 +01:00
A_D
8b0f3e74cf
Replaced format directives with fstrings
2020-07-26 23:08:47 +01:00
A_D
c6d8b4eab8
Renamed variable for clarity
2020-07-26 23:08:47 +01:00
A_D
0e000de90a
Replaced type annotation with Optional
...
The return is Optional so the annotation on the other side must be as
well, lest we have large red squiggles
2020-07-26 23:08:47 +01:00
A_D
3dfca91e1d
Fixed invalid deep_get call
2020-07-26 23:08:47 +01:00
A_D
b6482878f0
Fix deep_get not returning the correct on success
...
I forgot to actually return the given data if we manage to index to the
requested depth
2020-07-26 23:08:47 +01:00
A_D
2403ed1d2f
Replaced missed .get chains with deep_get
2020-07-26 23:08:47 +01:00
A_D
4ee8869426
Revert part of e510b783
...
Apparently config.get does _not_ take a default param. It really should.
2020-07-26 23:08:47 +01:00
A_D
664605a315
Cleaned up ifs where possible
...
Removed redundant or unneeded parens, correctly added line breaks where
needed
2020-07-26 23:08:47 +01:00
A_D
1ed9225c44
Added main guard
...
Modules should _always_ check that they are main before doing any "real"
work
2020-07-26 23:08:47 +01:00
A_D
637f58bb06
Replaced modulo-formatting with .format
2020-07-26 23:08:47 +01:00
A_D
0dfad42de3
Replaced .get chains with a new method
...
`deep_get` will go down a list of keys on a dict to find either the
requested key or the default if somewhere along the line the given dict
doesn't have a given key
2020-07-26 23:08:47 +01:00
A_D
8117e18963
Don't recompile regexps where possible
...
While the python re lib _does_ cache compiled regexps, it only does this
to a point, it's better to compile once and hold a reference
2020-07-26 23:08:47 +01:00
A_D
37c01c028c
Replaced list comprehension with generator
...
Creating a list here doesnt make sense when its almost instantly
recreated.
2020-07-26 23:08:47 +01:00
A_D
31c049deda
Replace sys.stderr.write call with print
...
`print()` supports files other than stdout, and will automatically add
newlines for us, among other things
2020-07-26 23:08:47 +01:00
A_D
f9b860fd5c
removed bare except clause
2020-07-26 23:08:47 +01:00
A_D
9d727aaa99
Remove unused variables in as e
clauses
2020-07-26 23:08:47 +01:00
A_D
2592af8c9f
block flake8 line length on doc line
2020-07-26 23:08:47 +01:00
A_D
2e21960568
add newlines on scope changes
2020-07-26 23:08:47 +01:00
A_D
1f1e34d722
ensure that comments have two spaces before
...
most of the files have tabs between code and comments
2020-07-26 23:08:47 +01:00
A_D
c6e61cc3da
Fix ~ not being expanded on linux
2020-07-26 23:08:47 +01:00
A_D
d67dd17367
ignore editor and virtual enviroment directories
...
Just to ensure that they're not reported by any local tools
2020-07-26 23:08:47 +01:00
A_D
179e06d6e9
added informational comment on private access
2020-07-26 23:08:47 +01:00
A_D
ecfed2b558
Modified dict comprehension to be more clear
2020-07-26 23:08:47 +01:00
A_D
d9658f2cf9
Fixed alignment and comment grammar
2020-07-26 23:08:47 +01:00
A_D
9a482cb04b
Added type annotations where needed
...
Not everywhere because they can be inferred in a lot of places. But I
added them to a lot of the self.* variables
2020-07-26 23:08:47 +01:00
A_D
21ab456e22
Added variables for repeatedly indexed keys
...
Repeatedly indexing keys is in general slow. And, not only is it slow,
it makes reading code hell.
2020-07-26 23:08:47 +01:00
A_D
12fdbd0678
Replaced x in list with x in tuple
...
Tuples are immutable, so this ensures that there isn't any funny business
at runtime
2020-07-26 23:08:47 +01:00
A_D
85c27e4cd7
Replaced or-based ternaries with standard ones
2020-07-26 23:08:47 +01:00
A_D
40aa4f9e63
Added whitespace on scope changes
2020-07-26 23:08:47 +01:00
A_D
a6d6599c3b
Moved logfile regexp to class level constant
...
Regular expressions are expensive to recompile constantly, and while the
python regexp library currently caches reuse, it only does so to a point
and that is not a required behaviour.
Compiling regexps once is simply best practice. On top of this, the
regexp was duplicated in various places.
2020-07-26 23:08:47 +01:00
A_D
b010b8015d
Aligned values of large dicts
...
helps your eyes track the changes
2020-07-26 23:08:47 +01:00
A_D
ed45d59af1
Replaced modulo formatters with .format formatters
2020-07-26 23:08:47 +01:00
A_D
05e6d49880
replaced list comp with generator where possible
2020-07-26 23:08:47 +01:00
A_D
33f25da270
Fixed ambiguous names and logic
2020-07-26 23:08:47 +01:00
A_D
1963140572
removed star import
2020-07-26 23:08:47 +01:00
A_D
f95bfd4280
removed bare except clauses
2020-07-26 23:08:47 +01:00
A_D
bf74e3647f
Fixed various whitespace issues
2020-07-26 23:08:47 +01:00
A_D
aeb328b31f
Removed oneliners
2020-07-26 23:08:47 +01:00
A_D
d877de2758
Ensured all lines are under 120 characters wide
2020-07-26 23:08:47 +01:00