mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-05 03:35:51 +00:00
* Common code extracted to Python directories. * Read ~/.scons file for scons environment defaults. * Override scons settings with shell environment variables. * New "tags" for debug, nodebug, optimize, nooptimize builds. * Universal platform detection. * Default value of environment variables set through prefix dictionaries. * Check for correct Boost value and fail otherwise. * Extract git describe --tags into a preprocesor variable, -DTIP_BRANCH * More colors - blue for unchanged defaults, green for changed defaults, red for error. * Contain unit tests for non-obvious stuff. * Check to see that boost libraries have been built. * Right now, we accept both .dylib and .a versions but it'd be easy to enforce .a only.
18 lines
540 B
Python
18 lines
540 B
Python
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
|
|
def compose(*dicts):
|
|
result = {}
|
|
for d in dicts:
|
|
result.update(**d)
|
|
return result
|
|
|
|
def get_items_with_prefix(key, mapping):
|
|
"""Get all elements from the mapping whose keys are a prefix of the given
|
|
key, sorted by increasing key length."""
|
|
for k, v in sorted(mapping.items()):
|
|
if key.startswith(k):
|
|
yield v
|
|
|
|
def compose_prefix_dicts(key, mapping):
|
|
return compose(*get_items_with_prefix(key, mapping))
|