Commit Graph

10 Commits

Author SHA1 Message Date
David Cassany
c8d5c5a02e
Make CommandCapabilities.check_version take the longest match
This commit ensures that when trying to parse the version of a tool
the comparison is done with the longest match for the given regular
expression. This solves cases such in `grub2` where the tool name
already provides some digit that could be seen as a version.
2020-04-16 10:25:21 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02:00
Dan Čermák
b015b91679
Stop inheriting from object
This is no longer required in Python3
2019-08-22 15:43:27 +02:00
Alberto Planas
0c095a98b1 Replace @staticmethod with @classmethod when needed
@classmethod are used in Python to represent methods that can
query and update the class (cls parameter). Is expected to be
used for metaprograming, or advanced techniques that require the
access to the class itself, before we have an instance.

@staticmethod are used to associate a function to a class. It will
not be have access to the instance (self) not the class (cls). In
other programming languages are known as class methods.

This patch replace all the @classmethod with @staticmethod when
there is not need to access to the cls parameter, because the
intention is to be used as normal functions.
2019-03-26 16:27:43 +01:00
Thomas Schraitle
3156bd14d8
Use cls in @classmethods instead of self
For consistency reasons.
2018-12-20 08:47:43 +01:00
Marcus Schäfer
afcbe93826
Fixed some code smells
* Use of unused variables, and dangerous defaults
* Update of design patterns on pylint and landscape
2018-07-11 10:31:04 +02:00
David Cassany
9eab3eebf9 Cleanup of the utils API docs 2018-04-17 18:05:09 +02:00
Marcus Schäfer
135fdcf4da
Extend has_option_in_help to also check error data 2018-03-02 10:04:13 +01:00
David Cassany
afbf2687c8 Extend CommandCapabilities to also check version 2018-01-16 16:53:59 +01:00
David Cassany Viladomat
02dc8e32e1
Update locale settings (#579)
* Use systemd-firstboot in order config basic settings

This commit updates locale and keyboard settings in order to make
use of the systemd tools, as this will be the only valid method starting
from SLE15.

Fixes #577

* Added CommandCapabilities utils class
2018-01-16 14:10:31 +01:00