def __init__(self, type, bit): self.config = configmanager.ConfigManager() self.build_type = type.lower() self.bit_type = bit if bit != "32" and bit != "64": print("Podana architektóra projektu różna od 32 i 64!\n") if type != "debug" and type != "release": print('Podany typ budowy różny od "debug" i "release"!\n')
def db_conf(): orig_config = configmanager.ConfigManager(test=True).get_specific_configuration("alerts_enricher") config = dict( host=orig_config["host"], port=orig_config["port"], user=orig_config["user"], password=orig_config["password"], database=orig_config["database"] ) yield config
def initialize(self): cfg = configmanager.ConfigManager() settings = cfg.load_settings() cfgit = settings.iterkeys() while True: try: k = cfgit.next() if k in self: self[k] = settings[k] except StopIteration: break
def postgres_db(db_conf): orig_config = configmanager.ConfigManager(test=True).get_specific_configuration("alerts_enricher") connection = PostgresClient(**db_conf) yield connection connection.close()
def configure_logging(set_environment): log_config = configmanager.ConfigManager().get_specific_configuration("logger") configurelogging.ConfigureLogging(**log_config)
logging.basicConfig(filename=logging_path, level=logging.DEBUG) logger = logging.getLogger(__name__) TEMPLATE_PATH.insert(0, template_dir) # Maximum request body size = 102,4 MB BaseRequest.MEMFILE_MAX = 1024 * 1e5 if len(sys.argv) < 2: logger.error('Config file missing!\nUsage: %s <config_file>' % sys.argv[0]) exit('Config file missing!\nUsage: %s <config_file>' % sys.argv[0]) else: config_file = sys.argv[1] try: cm = configmanager.ConfigManager(config_file) fm = filemanager.FileManager(cm) utils = repoutils.RepoUtils(cm) rm = repositorymanager.RepositoryManager(cm) except ConfigError: exit('Unable to parse config file.') except SQLError: exit('Error connecting to database.') requirementschecker.check_requirements(logger) jekyll_server = Bottle() @jekyll_server.get('/jekyll/') def list_all_repositories():
import yaml import logging import configmanager log = logging.getLogger('LongSphinx.Config') filename = 'config.yaml' conf = configmanager.ConfigManager(filename) def get_object(server, *hierarchy): server_id = 'default' if server and conf.config['servers'][server.id]: server_id = server.id found = conf.config['servers'][server_id] for level in hierarchy: try: found = found[level] except: log.error('Could not find {0} out of {1} on server {2}'.format( level, hierarchy, server_id)) return {} return found def get_string(server, stringname): return get_object(server, 'strings', stringname) def update_config(): conf.update_config()
def load_config(name): if name not in conf: conf[name] = configmanager.ConfigManager( 'genConfig/{0}.yaml'.format(name)) conf[name].update_config()
def __init__(self, config_file): try: self.__cm = configmanager.ConfigManager(config_file) except ConfigError: exit('Unable to parse config file.')
def generate(name): if name not in conf: conf[name] = configmanager.ConfigManager('{0}{1}.yaml'.format( mcDataPath, name)) conf[name].update_config() return MName(conf[name].config).New()
import configmanager import dynamicclassmanager import mapgen.enveffectmanager import eventmanager import mapgen.featuremanager import fontmanager import mapgen.furnituremanager import gameobjectmanager import imagemanager import mapgen.editor import mapgen.scenerymanager import soundmanager # Load this ahead of time because other modules need it ready so they can # load their configuration. dynamicClassManager = dynamicclassmanager.DynamicClassManager() animationManager = animationmanager.AnimationManager() configManager = configmanager.ConfigManager() envEffectManager = mapgen.enveffectmanager.EnvEffectManager() eventManager = eventmanager.EventManager() featureManager = mapgen.featuremanager.FeatureManager() fontManager = fontmanager.FontManager() furnitureManager = mapgen.furnituremanager.FurnitureManager() gameObjectManager = gameobjectmanager.GameObjectManager() imageManager = imagemanager.ImageManager() mapEditor = mapgen.editor.MapEditor() sceneryManager = mapgen.scenerymanager.SceneryManager() soundManager = soundmanager.SoundManager()