Loading gitlabci_local/package/settings.py +15 −1 Changes for gitlabci_local/package/settings.py: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ # Standard libraries from configparser import ConfigParser from sys import stdout # Components from ..prints.colors import Colors Loading Loading @@ -34,9 +35,16 @@ class Settings: if self.get('package', 'name') != name: raise ValueError('Missing settings files') except ValueError: self.__folder.mkdir(parents=True, exist_ok=True) self.__prepare() self.__reset(name) # Prepare def __prepare(self): # Prepare folder path if not Platform.IS_SIMULATED: self.__folder.mkdir(parents=True, exist_ok=True) # Reset def __reset(self, name): Loading @@ -48,6 +56,7 @@ class Settings: def __write(self): # Write initial settings if not Platform.IS_SIMULATED: with open(self.__path, 'w') as output: self.__settings.write(output) Loading Loading @@ -84,7 +93,12 @@ class Settings: Colors.RESET)) print(' ') # Settings simulated contents if Platform.IS_SIMULATED: self.__settings.write(stdout) # Settings file contents else: with open(self.__path, 'r') as data: print(data.read()) Platform.flush() Loading
gitlabci_local/package/settings.py +15 −1 Changes for gitlabci_local/package/settings.py: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ # Standard libraries from configparser import ConfigParser from sys import stdout # Components from ..prints.colors import Colors Loading Loading @@ -34,9 +35,16 @@ class Settings: if self.get('package', 'name') != name: raise ValueError('Missing settings files') except ValueError: self.__folder.mkdir(parents=True, exist_ok=True) self.__prepare() self.__reset(name) # Prepare def __prepare(self): # Prepare folder path if not Platform.IS_SIMULATED: self.__folder.mkdir(parents=True, exist_ok=True) # Reset def __reset(self, name): Loading @@ -48,6 +56,7 @@ class Settings: def __write(self): # Write initial settings if not Platform.IS_SIMULATED: with open(self.__path, 'w') as output: self.__settings.write(output) Loading Loading @@ -84,7 +93,12 @@ class Settings: Colors.RESET)) print(' ') # Settings simulated contents if Platform.IS_SIMULATED: self.__settings.write(stdout) # Settings file contents else: with open(self.__path, 'r') as data: print(data.read()) Platform.flush()