# Path: src/bin/tools.py
# def CheckDir(directory):
# 	'''
# 	 @brief Create directory
# 
# 	 @param directory Name of directory.
# 	'''
# 	if not(os.path.isdir(directory)):
# 		try:
# 			os.makedirs(directory)
# 		except Exception, err:
# 			warnings.simplefilter('always')
# 			warnings.warn(str(err), Warning)
# 			warnings.simplefilter('default')


from SettingsConfigured import SettingsConfigured
from src.bin.tools import CheckDir
from getpass import getpass
import sys, json, os, warnings
	def GetInitialSettings(self, reset_settings=None, settings_filename=None, skip_checking_for_user_input_cmd_line=False, skip_checking_for_user_input=False):
		'''
		 @brief Get initial settings from given json file, or from default values

		 @param reset_settings (True/False (default=None))
		 @param settings_filename (default=None)
		 @param skip_checking_for_user_input_cmd_line (True/False - default=False)
		 @param skip_checking_for_user_input (True/False - default=False)
		'''
		if not(isinstance(reset_settings, bool)):
			reset_settings = self._static_settings['reset_settings']

		settings_changed = False
		if reset_settings or not(self.LoadSettingsFromJson(settings_filename)):
			self.ResetSettings()
			settings_changed = True
		if not(skip_checking_for_user_input_cmd_line):
			if self.CheckForUserInputSettingsFromTerminal():
				settings_changed = True
		if settings_changed:
			self.SaveSettingsToJson(settings_filename)
		if not(skip_checking_for_user_input):
			self.CheckForUserInputSettings()

	def GetDefaultSettingsFilename(self):
		'''
		 @brief Get default save settings filename

		 @return filename
		'''

# Path: src/bin/tools.py
# def CheckDir(directory):
# 	'''
# 	 @brief Create directory
# 
# 	 @param directory Name of directory.
# 	'''
# 	if not(os.path.isdir(directory)):
# 		try:
# 			os.makedirs(directory)
# 		except Exception, err:
# 			warnings.simplefilter('always')
# 			warnings.warn(str(err), Warning)
# 			warnings.simplefilter('default')


# Path: Settings/Settings.py
from SettingsConfigured import SettingsConfigured
from src.bin.tools import CheckDir
from getpass import getpass
import sys, json, os, warnings

	def GetInitialSettings(self, reset_settings=None, settings_filename=None, skip_checking_for_user_input_cmd_line=False, skip_checking_for_user_input=False):
		'''
		 @brief Get initial settings from given json file, or from default values

		 @param reset_settings (True/False (default=None))
		 @param settings_filename (default=None)
		 @param skip_checking_for_user_input_cmd_line (True/False - default=False)
		 @param skip_checking_for_user_input (True/False - default=False)
		'''
		if not(isinstance(reset_settings, bool)):
			reset_settings = self._static_settings['reset_settings']

		settings_changed = False
		if reset_settings or not(self.LoadSettingsFromJson(settings_filename)):
			self.ResetSettings()
			settings_changed = True
		if not(skip_checking_for_user_input_cmd_line):
			if self.CheckForUserInputSettingsFromTerminal():
				settings_changed = True
		if settings_changed:
			self.SaveSettingsToJson(settings_filename)
		if not(skip_checking_for_user_input):
			self.CheckForUserInputSettings()

	def GetDefaultSettingsFilename(self):
		'''
		 @brief Get default save settings filename

		 @return filename
		'''

		CheckDir(self._static_settings['settings_params_folder'])