# Path: killMS/Other/ModColor.py
# HEADER = '\033[95m'
# OKBLUE = '\033[94m'
# OKGREEN = '\033[92m'
# WARNING = '\033[93m'
# FAIL = '\033[91m'
# ENDC = '\033[0m'
#     HEADER = ''
#     OKBLUE = ''
#     OKGREEN = ''
#     WARNING = ''
#     FAIL = ''
#     ENDC = ''
# def Str(strin0,col="red",Bold=True):
# def Sep(strin=None,D=1):
# def Title(strin,Big=False):
# def disable():
# 
# Path: killMS/Other/logo.py
# def report_version():
#     # perhaps we are in a github with tags; in that case return describe
#     path = os.path.dirname(os.path.abspath(__file__))
#     try:
#         # work round possible unavailability of git -C
#         result = subprocess.check_output('cd %s; git describe --tags' % path, shell=True, stderr=subprocess.STDOUT, universal_newlines=True).rstrip()
#     except subprocess.CalledProcessError:
#         result = None
# 
#     if result is not None and 'fatal' not in result:
#         # will succeed if tags exist
#         return result
#     else:
#         # perhaps we are in a github without tags? Cook something up if so
#         try:
#             result = subprocess.check_output('cd %s; git rev-parse --short HEAD' % path, shell=True, stderr=subprocess.STDOUT, universal_newlines=True).rstrip()
#         except subprocess.CalledProcessError:
#             result = None
#         if result is not None and 'fatal' not in result:
#             return __version__+'-'+result
#         else:
#             # we are probably in an installed version
#             return __version__


import collections
import optparse as OptParse
from . import PrintOptParse
from . import ReadCFG
from . import ClassPrint
from killMS.Other import ModColor
from killMS.Other.logo import report_version
                val=ReadCFG.FormatValue(val)
            self.DefaultDict[GroupName][Name]=val

        return self.DefaultDict

    def ToParset(self,ParsetName):
        Dico=self.GiveDicoConfig()
        f=open(ParsetName,"w")
        for MainKey in Dico.keys():
            f.write('[%s]\n'%MainKey)
            D=Dico[MainKey]
            for SubKey in D.keys():
                f.write('%s = %s \n'%(SubKey,str(D[SubKey])))
            f.write('\n')
        f.close()

    def Print(self,RejectGroup=[]):
        P=ClassPrint.ClassPrint(HW=50)
        print(ModColor.Str(" Selected Options:"))
    
        for Group,V in self.DefaultDict.items():
            Skip=False
            for Name in RejectGroup:
                if Name in Group:
                    Skip=True
            if Skip: continue
            try:
                GroupTitle=self.DicoGroupDesc[Group]
            except:
                GroupTitle=Group

# Path: killMS/Other/ModColor.py
# HEADER = '\033[95m'
# OKBLUE = '\033[94m'
# OKGREEN = '\033[92m'
# WARNING = '\033[93m'
# FAIL = '\033[91m'
# ENDC = '\033[0m'
#     HEADER = ''
#     OKBLUE = ''
#     OKGREEN = ''
#     WARNING = ''
#     FAIL = ''
#     ENDC = ''
# def Str(strin0,col="red",Bold=True):
# def Sep(strin=None,D=1):
# def Title(strin,Big=False):
# def disable():
# 
# Path: killMS/Other/logo.py
# def report_version():
#     # perhaps we are in a github with tags; in that case return describe
#     path = os.path.dirname(os.path.abspath(__file__))
#     try:
#         # work round possible unavailability of git -C
#         result = subprocess.check_output('cd %s; git describe --tags' % path, shell=True, stderr=subprocess.STDOUT, universal_newlines=True).rstrip()
#     except subprocess.CalledProcessError:
#         result = None
# 
#     if result is not None and 'fatal' not in result:
#         # will succeed if tags exist
#         return result
#     else:
#         # perhaps we are in a github without tags? Cook something up if so
#         try:
#             result = subprocess.check_output('cd %s; git rev-parse --short HEAD' % path, shell=True, stderr=subprocess.STDOUT, universal_newlines=True).rstrip()
#         except subprocess.CalledProcessError:
#             result = None
#         if result is not None and 'fatal' not in result:
#             return __version__+'-'+result
#         else:
#             # we are probably in an installed version
#             return __version__


# Path: killMS/Parset/MyOptParse.py
import collections
import optparse as OptParse
from . import PrintOptParse
from . import ReadCFG
from . import ClassPrint
from killMS.Other import ModColor
from killMS.Other.logo import report_version

                val=ReadCFG.FormatValue(val)
            self.DefaultDict[GroupName][Name]=val

        return self.DefaultDict

    def ToParset(self,ParsetName):
        Dico=self.GiveDicoConfig()
        f=open(ParsetName,"w")
        for MainKey in Dico.keys():
            f.write('[%s]\n'%MainKey)
            D=Dico[MainKey]
            for SubKey in D.keys():
                f.write('%s = %s \n'%(SubKey,str(D[SubKey])))
            f.write('\n')
        f.close()

    def Print(self,RejectGroup=[]):
        P=ClassPrint.ClassPrint(HW=50)
        print(ModColor.Str(" Selected Options:"))
    
        for Group,V in self.DefaultDict.items():
            Skip=False
            for Name in RejectGroup:
                if Name in Group:
                    Skip=True
            if Skip: continue
            try:
                GroupTitle=self.DicoGroupDesc[Group]
            except:
                GroupTitle=Group

            print(ModColor.Str(GroupTitle,col="green"))