Example #1
0
    def contentmodel_configure(self, config):
        True_list = ["true", "1", "t", "y", "yes", "yeah", "yup", "certainly"]

        if 'usgin_url' in config:
            contentmodels.usgin_url = config['usgin_url']
        else:
            try:
                contentmodels.usgin_url = 'http://schemas.usgin.org/contentmodels.json'
            except:
                print 'Could not access ' + contentmodels.usgin_url
                pass
        contentmodel_action.contentmodel_refreshCache(None, None)

        if 'checkfile_maxerror' in config:
            try:
                checkfile_maxerror = config['checkfile_maxerror']
                contentmodels.checkfile_maxerror = int(checkfile_maxerror)
            except:
                print '"checkfile_maxerror" variable in config file is not an integer'
                pass

        if 'checkfile_checkheader' in config:
            try:
                checkfile_checkheader = config['checkfile_checkheader']
                if checkfile_checkheader in True_list:
                    contentmodels.checkfile_checkheader = True
                else:
                    contentmodels.checkfile_checkheader = False
            except:
                print '"checkfile_checkheader" variable in config file is not a boolean string'
                pass

        if 'checkfile_checkoptionalfalse' in config:
            try:
                checkfile_checkoptionalfalse = config['checkfile_checkoptionalfalse']
                if checkfile_checkoptionalfalse in True_list:
                    contentmodels.checkfile_checkoptionalfalse = True
                else:
                    contentmodels.checkfile_checkoptionalfalse = False
            except:
                print '"checkfile_checkoptionalfalse" variable in config file is not a boolean string'
                pass
Example #2
0
    def contentmodel_configure(self, config):
        True_list = ["true", "1", "t", "y", "yes", "yeah", "yup", "certainly"]

        if 'usgin_url' in config:
            contentmodels.usgin_url = config['usgin_url']
        else:
            try:
                contentmodels.usgin_url = 'http://schemas.usgin.org/contentmodels.json'
            except:
                print 'Could not access ' + contentmodels.usgin_url
                pass
        contentmodel_action.contentmodel_refreshCache(None, None)

        if 'checkfile_maxerror' in config:
            try:
                checkfile_maxerror = config['checkfile_maxerror']
                contentmodels.checkfile_maxerror = int(checkfile_maxerror)
            except:
                print '"checkfile_maxerror" variable in config file is not an integer'
                pass

        if 'checkfile_checkheader' in config:
            try:
                checkfile_checkheader = config['checkfile_checkheader']
                if checkfile_checkheader in True_list:
                    contentmodels.checkfile_checkheader = True
                else:
                    contentmodels.checkfile_checkheader = False
            except:
                print '"checkfile_checkheader" variable in config file is not a boolean string'
                pass

        if 'checkfile_checkoptionalfalse' in config:
            try:
                checkfile_checkoptionalfalse = config['checkfile_checkoptionalfalse']
                if checkfile_checkoptionalfalse in True_list:
                    contentmodels.checkfile_checkoptionalfalse = True
                else:
                    contentmodels.checkfile_checkoptionalfalse = False
            except:
                print '"checkfile_checkoptionalfalse" variable in config file is not a boolean string'
                pass
Example #3
0
    def contentmodel_configure(self, config):
        if "usgin_url" in config:
            contentmodels.usgin_url = config["usgin_url"]
        else:
            contentmodels.usgin_url = "http://schemas.usgin.org/contentmodels.json"
            # Access the URL and fill the cache
        print "Caching Content Models from USGIN: " + contentmodels.usgin_url
        contentmodel_action.contentmodel_refreshCache(None, None)

        True_List = ["true", "1", "t", "y", "yes", "yeah", "yup", "certainly"]

        if "checkfile_maxerror" in config:
            try:
                checkfile_maxerror = config["checkfile_maxerror"]
                contentmodels.checkfile_maxerror = int(checkfile_maxerror)
            except:
                print "DON'T UNDERSTAND the 'checkfile_maxerror' in the development.ini, it is not an Integer"
        print "checkfile_maxerror", contentmodels.checkfile_maxerror

        if "checkfile_checkheader" in config:
            try:
                checkfile_checkheader = config["checkfile_checkheader"]
                if checkfile_checkheader in True_List:
                    contentmodels.checkfile_checkheader = True
                else:
                    contentmodels.checkfile_checkheader = False
            except:
                print "DON'T UNDERSTAND the 'checkfile_checkheader' in the development.ini, it is not a boolean string"
        print "checkfile_checkheader", contentmodels.checkfile_checkheader

        if "checkfile_checkoptionalfalse" in config:
            try:
                checkfile_checkoptionalfalse = config[
                    "checkfile_checkoptionalfalse"]
                if checkfile_checkoptionalfalse in True_List:
                    contentmodels.checkfile_checkoptionalfalse = True
                else:
                    contentmodels.checkfile_checkoptionalfalse = False
            except:
                print "DON'T UNDERSTAND the 'checkfile_checkoptionalfalse' in the development.ini, it is not a boolean string"
        print "checkfile_checkoptionalfalse", contentmodels.checkfile_checkoptionalfalse