Commit Graph

5 Commits (d2596294456da9f5ffa809a67a2d68fa21ce1fb3)

Author SHA1 Message Date
Jose M. Guisado d90ab82cec format: use autopep8
Use autopep8 for coding format, and only for whitespace changes. This
change drops use of tabs in favor of spaces.

Doesn't use autopep8 --aggresive option.

Format command:

$ autopep8 --inline --recursive .

When using git-blame, use --ignore-rev in order to ignore this
reformatting commit.
2022-05-20 10:22:42 +02:00
Jose M. Guisado b765ee50d3 utils: add print_json
Adds a pretty printing function for JSON data.

Replaces print for print_json in corresponding cli objects.

Follows commit 828d6c0ce7
("list scopes: pretty print scope tree")
2022-05-17 11:24:49 +02:00
OpenGnSys Support Team 5f922571e2 ogCLI is AGPLv3+
Update license header in files.
2021-05-14 00:26:33 +02:00
Jose M. Guisado 40bd146377 Fix utils.py
When utils.py was created, moved functions declaration was not kept for
scope_lookup by mistake, in previous commit it was named
'scope_lookup_id'.

ips_in_scope is a function that maps a list of scopes to the list of ips
contained in it, recursively. (if the scope is a room it will gather all
computers ips in that room). Add 'None' check for its scope param,
avoiding duplication of this check in several other objects using this
function.

Also import utils in 'modes' object, which was not added previously.

Fixes: be84b0a ("Add utils.py")
2021-03-30 13:29:06 +02:00
Jose M. Guisado be84b0a15c Add utils.py
Move auxiliary code that will be used by several objects. In this case,
scope filtering and searching by id is going to be used by 'send wol'
too.

Avoid duplicating this code creating utils.py
2021-03-29 13:47:18 +02:00