Module osbot_utils.utils.Version

Expand source code
import osbot_utils
from osbot_utils.utils.Files import file_contents, path_combine

class Version:

    FILE_NAME_VERSION = 'version'

    def path_code_root(self):
        return osbot_utils.path

    def path_version_file(self):
        return path_combine(self.path_code_root(), self.FILE_NAME_VERSION)

    def value(self):
        version = file_contents(self.path_version_file()) or ""
        return version.strip()

Classes

class Version
Expand source code
class Version:

    FILE_NAME_VERSION = 'version'

    def path_code_root(self):
        return osbot_utils.path

    def path_version_file(self):
        return path_combine(self.path_code_root(), self.FILE_NAME_VERSION)

    def value(self):
        version = file_contents(self.path_version_file()) or ""
        return version.strip()

Class variables

var FILE_NAME_VERSION

Methods

def path_code_root(self)
Expand source code
def path_code_root(self):
    return osbot_utils.path
def path_version_file(self)
Expand source code
def path_version_file(self):
    return path_combine(self.path_code_root(), self.FILE_NAME_VERSION)
def value(self)
Expand source code
def value(self):
    version = file_contents(self.path_version_file()) or ""
    return version.strip()