Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(33)  |  Call(25)  |  Derive(0)  |  Import(8)
Ordered dict example implementation.

This is the proposed interface for a an ordered dict as proposed on the
Python mailinglist (proposal_).

It's a dict subclass and provides some list functions.  The implementation
of this class is inspired by the implementation of Babel but incorporates
some ideas from the `ordereddict`_ and Django's ordered dict.

The constructor and `update()` both accept iterables of tuples as well as(more...)

src/m/a/mapproxy-HEAD/mapproxy/config/loader.py   mapproxy(Download)
from mapproxy.config.spec import validate_mapproxy_conf
from mapproxy.util.py import memoize
from mapproxy.util.ext.odict import odict
from mapproxy.util.yaml import load_yaml_file, YAMLError
 
    def load_caches(self):
        self.caches = odict()
        caches_conf = self.configuration.get('caches')
        if not caches_conf: return
        if isinstance(caches_conf, list):
    def load_tile_layers(self):
        self.layers = odict()
        layers_conf = deepcopy(self._layers_conf_dict())
        if layers_conf is None: return
        layers = self._flatten_layers_conf_dict(layers_conf)
        Flattens the layer tree.
        """
        layers = _layers if _layers is not None else odict()
 
        if 'layers' in layers_conf:
    """
 
    result = odict()
    for d in dictlist:
        for k, v in d.iteritems():

src/m/a/MapProxy-1.6.0/mapproxy/config/loader.py   MapProxy(Download)
from mapproxy.config.spec import validate_mapproxy_conf
from mapproxy.util.py import memoize
from mapproxy.util.ext.odict import odict
from mapproxy.util.yaml import load_yaml_file, YAMLError
 
    def load_caches(self):
        self.caches = odict()
        caches_conf = self.configuration.get('caches')
        if not caches_conf: return
        if isinstance(caches_conf, list):
    def load_tile_layers(self):
        self.layers = odict()
        layers_conf = deepcopy(self._layers_conf_dict())
        if layers_conf is None: return
        layers = self._flatten_layers_conf_dict(layers_conf)
        Flattens the layer tree.
        """
        layers = _layers if _layers is not None else odict()
 
        if 'layers' in layers_conf:
    """
 
    result = odict()
    for d in dictlist:
        for k, v in d.iteritems():

src/m/a/MapProxy-1.6.0/mapproxy/service/wms.py   MapProxy(Download)
from mapproxy.util.py import cached_property
from mapproxy.util.coverage import load_limited_to
from mapproxy.util.ext.odict import odict
from mapproxy.template import template_loader, bunch
from mapproxy.service import template_helper
            query.tiled_only = True
 
        actual_layers = odict()
        for layer_name in map_request.params.layers:
            layer = self.layers[layer_name]
                # remove already added (then hidden) layers
                if not layer.transparent:
                    actual_layers = odict()
                for layer_name, map_layers in layer.map_layers_for_query(query):
                    actual_layers[layer_name] = map_layers
              feature_count=p.get('feature_count'))
 
        actual_layers = odict()
 
        for layer_name in request.params.query_layers:
    def child_layers(self):
        layers = odict()
        if self.name:
            layers[self.name] = self
        for lyr in self.layers:

src/m/a/mapproxy-HEAD/mapproxy/service/wms.py   mapproxy(Download)
from mapproxy.util.py import cached_property
from mapproxy.util.coverage import load_limited_to
from mapproxy.util.ext.odict import odict
from mapproxy.template import template_loader, bunch
from mapproxy.service import template_helper
                query = MapQuery(sub_bbox, sub_size, SRS(params.srs), params.format)
 
        actual_layers = odict()
        for layer_name in map_request.params.layers:
            layer = self.layers[layer_name]
                # remove already added (then hidden) layers
                if not layer.transparent:
                    actual_layers = odict()
                for layer_name, map_layers in layer.map_layers_for_query(query):
                    actual_layers[layer_name] = map_layers
              feature_count=p.get('feature_count'))
 
        actual_layers = odict()
 
        for layer_name in request.params.query_layers:
    def child_layers(self):
        layers = odict()
        if self.name:
            layers[self.name] = self
        for lyr in self.layers:

src/m/a/MapProxy-1.6.0/mapproxy/service/tile.py   MapProxy(Download)
from mapproxy.image.opts import ImageOptions
from mapproxy.image.mask import mask_image_source_from_coverage
from mapproxy.util.ext.odict import odict
from mapproxy.util.coverage import load_limited_to
 
            if result['authorized'] == 'none':
                raise RequestError('forbidden', status=403)
            allowed_layers = odict()
            for layer in self.layers.itervalues():
                if result['layers'].get(layer.name, {}).get('tile', False) == True:

src/m/a/mapproxy-HEAD/mapproxy/service/tile.py   mapproxy(Download)
from mapproxy.image.opts import ImageOptions
from mapproxy.image.mask import mask_image_source_from_coverage
from mapproxy.util.ext.odict import odict
from mapproxy.util.coverage import load_limited_to
 
            if result['authorized'] == 'none':
                raise RequestError('forbidden', status=403)
            allowed_layers = odict()
            for layer in self.layers.itervalues():
                if result['layers'].get(layer.name, {}).get('tile', False) == True:

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_decorate_img.py   mapproxy(Download)
from mapproxy.service.wmts import WMTSServer
from mapproxy.test.http import make_wsgi_env
from mapproxy.util.ext.odict import odict
from nose.tools import eq_
 
        )
        # Tile Servers
        layers = odict()
        layers["wms_cache_EPSG900913"] = DummyTileLayer('wms_cache')
        self.tile_server = TileServer(layers, {})

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_decorate_img.py   MapProxy(Download)
from mapproxy.service.wmts import WMTSServer
from mapproxy.test.http import make_wsgi_env
from mapproxy.util.ext.odict import odict
from nose.tools import eq_
 
        )
        # Tile Servers
        layers = odict()
        layers["wms_cache_EPSG900913"] = DummyTileLayer('wms_cache')
        self.tile_server = TileServer(layers, {})