DataPipeline/Base.py
def createConfig(self, conffile='default.conf', **kwargs):
        """Create a basic config file with default options and/or custom values"""

        c = ConfigParser.ConfigParser()
        wdir = os.path.join(self.defaultpath,'workingdir')
        functionsconf = os.path.join(self.defaultpath,'functions.conf')
        defaults = {'base': [('format', 'databyrow'), ('rowstart', 0), ('colstart', 0), ('rowend', 0),
                        ('colend', 0), ('colheaderstart', 0),('rowheaderstart', 0),
                        ('rowheader', ''), ('colheader', ''),
                        ('colheaderlabels', ''), ('rowheaderlabels', ''),
                        ('rowrepeat', 0), ('colrepeat', 0), ('delimeter', ','),
                        ('workingdir', wdir), ('functionsconf',functionsconf),
                        ('ignorecomments', 1),
                        ('decimalsymbol', '.'), ('preprocess',''),
                        ('xformat',''), ('yformat',''), ('groupbyfields', 0)],
                    'files': [('groupbyname', 0), ('parsenamesindex', ''),
                              ('filenameseparator',''), ('parsemethod','words'),
                              ('replicates',0), ('extension','.txt')],
                    'models': [('model1', '')], 'variables': [('variable1', '')],
                    'functions':[('function1','')],
                    'excel': [('sheet', 0), ('numsheets', 1)],
                    'plotting': [('saveplots', 0), ('fontsize',9),
                            ('normalise', 0), ('grayscale', 0), ('alpha',0.8),
                            ('font','sans-serif'), ('markersize',25), ('linewidth',1),
                            ('showerrorbars',0), ('dpi', 100), ('marker','o'),
                            ('markers','-,o'),('legend',0)],
                    'custom': [],
                    'fitting': [('xerror', 0), ('yerror', 0), ('iterations', 50),
                                ('modelsfile','')],
                    }

        cp = Utilities.createConfigParserfromDict(defaults, self.configsections ,**kwargs)
        cp.write(open(conffile,'w'))
        self.parseConfig(conffile)
        return cp
Create a basic config file with default options and/or custom values
Create a basic config file with default options and/or custom values
Create a basic config file with default options and / or custom values
def createConfig(self, conffile='default.conf', **kwargs):
        c = ConfigParser.ConfigParser()
        wdir = os.path.join(self.defaultpath,'workingdir')
        functionsconf = os.path.join(self.defaultpath,'functions.conf')
        defaults = {'base': [('format', 'databyrow'), ('rowstart', 0), ('colstart', 0), ('rowend', 0),
                        ('colend', 0), ('colheaderstart', 0),('rowheaderstart', 0),
                        ('rowheader', ''), ('colheader', ''),
                        ('colheaderlabels', ''), ('rowheaderlabels', ''),
                        ('rowrepeat', 0), ('colrepeat', 0), ('delimeter', ','),
                        ('workingdir', wdir), ('functionsconf',functionsconf),
                        ('ignorecomments', 1),
                        ('decimalsymbol', '.'), ('preprocess',''),
                        ('xformat',''), ('yformat',''), ('groupbyfields', 0)],
                    'files': [('groupbyname', 0), ('parsenamesindex', ''),
                              ('filenameseparator',''), ('parsemethod','words'),
                              ('replicates',0), ('extension','.txt')],
                    'models': [('model1', '')], 'variables': [('variable1', '')],
                    'functions':[('function1','')],
                    'excel': [('sheet', 0), ('numsheets', 1)],
                    'plotting': [('saveplots', 0), ('fontsize',9),
                            ('normalise', 0), ('grayscale', 0), ('alpha',0.8),
                            ('font','sans-serif'), ('markersize',25), ('linewidth',1),
                            ('showerrorbars',0), ('dpi', 100), ('marker','o'),
                            ('markers','-,o'),('legend',0)],
                    'custom': [],
                    'fitting': [('xerror', 0), ('yerror', 0), ('iterations', 50),
                                ('modelsfile','')],
                    }
        cp = Utilities.createConfigParserfromDict(defaults, self.configsections ,**kwargs)
        cp.write(open(conffile,'w'))
        self.parseConfig(conffile)
        return cp
def createConfig ( self , conffile = 'default.conf' , ** kwargs ) : c = ConfigParser . ConfigParser ( ) wdir = os . path . join ( self . defaultpath , 'workingdir' ) functionsconf = os . path . join ( self . defaultpath , 'functions.conf' ) defaults = { 'base' : [ ( 'format' , 'databyrow' ) , ( 'rowstart' , 0 ) , ( 'colstart' , 0 ) , ( 'rowend' , 0 ) , ( 'colend' , 0 ) , ( 'colheaderstart' , 0 ) , ( 'rowheaderstart' , 0 ) , ( 'rowheader' , '' ) , ( 'colheader' , '' ) , ( 'colheaderlabels' , '' ) , ( 'rowheaderlabels' , '' ) , ( 'rowrepeat' , 0 ) , ( 'colrepeat' , 0 ) , ( 'delimeter' , ',' ) , ( 'workingdir' , wdir ) , ( 'functionsconf' , functionsconf ) , ( 'ignorecomments' , 1 ) , ( 'decimalsymbol' , '.' ) , ( 'preprocess' , '' ) , ( 'xformat' , '' ) , ( 'yformat' , '' ) , ( 'groupbyfields' , 0 ) ] , 'files' : [ ( 'groupbyname' , 0 ) , ( 'parsenamesindex' , '' ) , ( 'filenameseparator' , '' ) , ( 'parsemethod' , 'words' ) , ( 'replicates' , 0 ) , ( 'extension' , '.txt' ) ] , 'models' : [ ( 'model1' , '' ) ] , 'variables' : [ ( 'variable1' , '' ) ] , 'functions' : [ ( 'function1' , '' ) ] , 'excel' : [ ( 'sheet' , 0 ) , ( 'numsheets' , 1 ) ] , 'plotting' : [ ( 'saveplots' , 0 ) , ( 'fontsize' , 9 ) , ( 'normalise' , 0 ) , ( 'grayscale' , 0 ) , ( 'alpha' , 0.8 ) , ( 'font' , 'sans-serif' ) , ( 'markersize' , 25 ) , ( 'linewidth' , 1 ) , ( 'showerrorbars' , 0 ) , ( 'dpi' , 100 ) , ( 'marker' , 'o' ) , ( 'markers' , '-,o' ) , ( 'legend' , 0 ) ] , 'custom' : [ ] , 'fitting' : [ ( 'xerror' , 0 ) , ( 'yerror' , 0 ) , ( 'iterations' , 50 ) , ( 'modelsfile' , '' ) ] , } cp = Utilities . createConfigParserfromDict ( defaults , self . configsections , ** kwargs ) cp . write ( open ( conffile , 'w' ) ) self . parseConfig ( conffile ) return cp
Create a basic config file with default options and/or custom values
Create a basic config file with default options and / or custom values
"""Create a basic config file with default options and/or custom values"""
self
conffile