a math slouch I want to be told the sum of two numbers Scenario: Add two numbers Given I have entered 50 into the calc And I have entered 70 into the calc When I press add Then the result should be 120 • Domain-Specific Languages • SQLite • Windows registry
filter host mimetype route setting sqlite> select * from host; 1|1|0|localhost|localhost sqlite> select count(*) from mimetype; 850 sqlite> select * from server; • Domain-Specific Languages • SQLite • Windows registry # get s list of the available servers to run m2sh servers -db tests/config.sqlite # see what hosts a server has m2sh hosts -db tests/config.sqlite -server test # find out if a server named 'test' is running m2sh running -db tests/config.sqlite -name test # start a server who's default host is 'localhost' m2sh start -db tests/config.sqlite -host localhost
- 100%[======>] 19,090,076 1.23M/s in 17s ambv@arrakis:~ $ ./.dropbox- dist/dropboxd This client is not linked to any account... Please visit https://www.dropbox.com/cli_link?
= 'en-us' SECRET_KEY = 'secret' # ... from settings_local import * • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration
settings_base.py defines the base configuration • settings_prod.py, settings_dev.py, etc. import settings_base.py at the beginning • run with DJANGO_SETTINGS_MODULE = proj.settings_prod • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration
glob.glob( os.path.join( os.path.dirname(__file__), 'settings', '*.conf’ ) ) conffiles.sort() for f in conffiles: execfile(os.path.abspath(f )) • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration
glob.glob( os.path.join( os.path.dirname(__file__), 'settings', '*.conf’ ) ) conffiles.sort() for f in conffiles: execfile(os.path.abspath(f )) • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration $ ls settings/ 10-base.conf 20-engines.conf 30-site.conf ...
'Europe/Berlin' class Dev(Base): DEBUG = True TEMPLATE_DEBUG = DEBUG class Prod(Base): TIME_ZONE = 'America/New_York’ • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration
True class Base(Settings): TIME_ZONE = 'Europe/Berlin' class Dev(Base): DEBUG = True TEMPLATE_DEBUG = DEBUG class Prod(Base, FullPageCaching): • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration
You can do a hierarchy like: 1. site-packages/project/config- defaults.ini 2. /etc/project/config.ini 3. /etc/project.d/10-config.ini 4. /etc/project.d/20-config.ini 5. ~/.project/config.ini 6. ENVIRONMENT_VARIABLE • The problem • from settings import * • Ordered incremental execfile • django- configurations • INI based configuration