mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
target: Add KernelVersion docstring
This commit is contained in:
parent
03561ee72c
commit
54adf80eab
@ -1189,7 +1189,29 @@ class Cpuinfo(object):
|
|||||||
|
|
||||||
|
|
||||||
class KernelVersion(object):
|
class KernelVersion(object):
|
||||||
|
"""
|
||||||
|
Class representing the version of a target kernel
|
||||||
|
|
||||||
|
Not expected to work for very old (pre-3.0) kernel version numbers.
|
||||||
|
|
||||||
|
:ivar release: Version number/revision string. Typical output of
|
||||||
|
``uname -r``
|
||||||
|
:type release: str
|
||||||
|
:ivar version: Extra version info (aside from ``release``) reported by
|
||||||
|
``uname``
|
||||||
|
:type version: str
|
||||||
|
:ivar version_number: Main version number (e.g. 3 for Linux 3.18)
|
||||||
|
:type version_number: int
|
||||||
|
:ivar major: Major version number (e.g. 18 for Linux 3.18)
|
||||||
|
:type major: int
|
||||||
|
:ivar minor: Minor version number for stable kernels (e.g. 9 for 4.9.9). May
|
||||||
|
be None
|
||||||
|
:type minor: int
|
||||||
|
:ivar rc: Release candidate number (e.g. 3 for Linux 4.9-rc3). May be None.
|
||||||
|
:type rc: int
|
||||||
|
:ivar sha1: Kernel git revision hash, if available (otherwise None)
|
||||||
|
:type sha1: str
|
||||||
|
"""
|
||||||
def __init__(self, version_string):
|
def __init__(self, version_string):
|
||||||
if ' #' in version_string:
|
if ' #' in version_string:
|
||||||
release, version = version_string.split(' #')
|
release, version = version_string.split(' #')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user