Add EnvironmentApi

This commit is contained in:
bom 2023-03-17 11:32:01 +01:00
parent 85250f1c5f
commit befb5eb653

View file

@ -3,7 +3,7 @@ import re
import subprocess as sub import subprocess as sub
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from pathlib import Path from pathlib import Path
from os import environ
class FileHandler(ABC): class FileHandler(ABC):
@ -235,3 +235,14 @@ class GitApi():
def checkout(self, branch: str): def checkout(self, branch: str):
self.system_api.run_checked('git', 'checkout', branch) self.system_api.run_checked('git', 'checkout', branch)
return self.system_api.stdout return self.system_api.stdout
class EnvironmentApi():
def __init__(self):
self.environ = environ
def get(self, key):
return self.environ[key]
def set(self, key, value):
self.environ[key] = value