configuration-files

Custom configuration in .NET

放肆的年华 提交于 2019-12-09 18:58:48
问题 I am seeing simple examples regarding custom configuration in .NET. My case is a bit more complex, with nested nodes. I'd like to be able to read this from the configuration file: <environments> <environment name="live" url="http://www.live.com"> <server name="a" IP="192.168.1.10"></server> <server name="b" IP="192.168.1.20"></server> <server name="c" IP="192.168.1.30"></server> </environment> <environment name="dev" url="http://www.dev.com"> <server name="a" IP="192.168.1.10"></server>

Python: Decent config file format

谁说胖子不能爱 提交于 2019-12-09 15:57:17
问题 I'd like to use a configuration file format which supports key value pairs and nestable, repeatable structures, and which is as light on syntax as possible. I'm imagining something along the lines of: cachedir = /var/cache mail_to = me@example.org job { name = my-media frequency = 1 day source { from = /home/michael/Images source { } source { } } job { } I'd be happy with something using significant-whitespace as well. JSON requires too many explicit syntax rules (quoting, commas, etc.). YAML

Symfony2 - Why use XML for settings/config?

青春壹個敷衍的年華 提交于 2019-12-09 03:34:21
问题 Is there any interest to use XML over YAML for each of these types of file: config security routing services translations I would like to ask XML vs YAML and JSON globally, but I'll stick to these topics :) 回答1: In my company projects for each of mentioned above points we use YAML because it is more readable. The most readable. The readablest. EDIT : The only abstract situation I can imagine for using XML over YAML - is probably for some dynamic file writers, since it is easier to manipulate

Again, user config files C#

大兔子大兔子 提交于 2019-12-09 03:23:28
I have a large config file (user) that i needed to go to the right location and have some default values. Since i have a installer class, i added some parameter setting to the config file in it, but created the config files in the installers folder. What is the best way to ensure these default parameters will be written only once, and in the right location? A standard way of using defaults in the app.config. For example, here's a default value per version I use to ensure the code copies user settings between upgrades: <userSettings> <Software.Namespace.Properties.UserSettings> <setting name=

Use app.config from fsx file

天大地大妈咪最大 提交于 2019-12-08 19:58:40
问题 Is it possible to use an app.config file from a F# script (fsx) file? If so, how? Where do I put the file and what will it be called? 回答1: The linked question by @JoeB provides 2 answers which are more suited to F# Interactive than .fsx scripts. I provide a good solution for F# scripts below: Given this app.config file: <configuration> <appSettings> <add key="foo" value="bar"/> </appSettings> </configuration> Read foo this way: let appConfigPath = System.IO.Path.Combine(Directory

How to save a configuration file / python file IO

╄→гoц情女王★ 提交于 2019-12-08 11:42:19
问题 I have this python code for opening a .cfg file, writing to it and saving it: import ConfigParser def get_lock_file(): cf = ConfigParser.ConfigParser() cf.read("svn.lock") return cf def save_lock_file(configurationParser): cf = configurationParser config_file = open('svn.lock', 'w') cf.write(config_file) config_file.close() Does this seem normal or am I missing something about how to open-write-save files? Is there a more standard way to read and write config files? I ask because I have two

Openshift/Kubernetes: disoriented by the various configuration files

时光毁灭记忆、已成空白 提交于 2019-12-08 10:52:44
问题 I'm learning openshift origin , in the master container I found a number of config files: [root@openshift] cd /var/lib/origin [root@openshift origin]# find . -name *kubeconfig ./openshift.local.config/node-localhost/node.kubeconfig ./openshift.local.config/master/admin.kubeconfig ./openshift.local.config/master/openshift-master.kubeconfig [root@openshift origin]# find . -name *config.yaml ./openshift.local.config/node-localhost/node-config.yaml ./openshift.local.config/master/master-config

Merge config files in symfony2

核能气质少年 提交于 2019-12-08 09:50:18
问题 I build config for my bundle using ConfigurationInterface. My extension file look like this: public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $container->setParameter('my_admin_included_bundles', $config['included_bundles_namespace']); $container->setParameter('my_admin_widget_script_file', $config['widget_script_file']); $container->setParameter('my_admin_widgets',

java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringDispatcher-servlet.xml]

杀马特。学长 韩版系。学妹 提交于 2019-12-08 04:14:23
问题 When I launch my application I get this error java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringDispatcher-servlet.xml] nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringDispatcher-servlet.xml] Meanwhile, I dont have any file like SpringDispatcher-servlet.xml neither do I in my web.xml or mvc-dispatcher-servlet.xml file defined in my WEB-INF folder. web.xml file <context-param> <param-name>contextClass

Adding a Custom Configuration file in C# application

笑着哭i 提交于 2019-12-08 03:10:01
问题 Is it possible to create a custom configuration file (other than app.config) that can be processed by classes in the System.Configuration namespace? I have seen a ton of articles that talk about custom sections (inside the app.config file) but I would like to make an entirely new config file. Is there any decent documentation that covers this topic? thanks 回答1: You do not state what you want to achieve by having a separate file, but there are a couple of different things you can do. If you