<commit_before>#!/usr/bin/python

# BSD Licensed, Copyright (c) 2006-2010 TileCache Contributors

class TileCacheException(Exception): pass

import sys, cgi, time, os, traceback, email, ConfigParser
import Cache, Caches
import Layer, Layers

# Windows doesn't always do the 'working directory' check correctly.
if sys.platform == 'win32':
    workingdir = os.path.abspath(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0])))
    cfgfiles = (os.path.join(workingdir, "tilecache.cfg"), os.path.join(workingdir,"..","tilecache.cfg"))
else:
    cfgfiles = ("/etc/tilecache.cfg", os.path.join("..", "tilecache.cfg"), "tilecache.cfg")


class Capabilities (object):
    def __init__ (self, format, data):
        self.format = format
        self.data   = data

class Request (object):
    def __init__ (self, service):
        self.service = service
    def getLayer(self, layername):    
        #try:
        if layername.find('idep') == 0:
            (blah, ltype, date) = layername.split("::", 3)
            uri = 'date=%s&year=%s' % (date, date[:4])
            layer = self.service.layers['idep']
            layer.name = layername
            layer.layers = ltype
            layer.url = "%s%s" % (layer.metadata['baseurl'], uri)
        elif layername.find("::") > 0:
            (sector,prod,tstring) = (layername.split("::")[1]).split('-')
            if len(tstring) == 12:
                mylayername = 'ridge-t'
                if sector in ['USCOMP',]:
                    mylayername = 'ridge-composite-t'
                    sector = sector.lower()
                    prod = prod.lower()
                year = tstring[:4]
                month = tstring[4:6]
                day = tstring[6:8]
                ts = tstring[8:12]
                uri = "year=%s&month=%s&day=%s&time=%s&" % (year, <commit_msg>pass month and day down to IDEP<commit_after>#!/usr/bin/python

# BSD Licensed, Copyright (c) 2006-2010 TileCache Contributors

class TileCacheException(Exception): pass

import sys, cgi, time, os, traceback, email, ConfigParser
import Cache, Caches
import Layer, Layers

# Windows doesn't always do the 'working directory' check correctly.
if sys.platform == 'win32':
    workingdir = os.path.abspath(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0])))
    cfgfiles = (os.path.join(workingdir, "tilecache.cfg"), os.path.join(workingdir,"..","tilecache.cfg"))
else:
    cfgfiles = ("/etc/tilecache.cfg", os.path.join("..", "tilecache.cfg"), "tilecache.cfg")


class Capabilities (object):
    def __init__ (self, format, data):
        self.format = format
        self.data   = data

class Request (object):
    def __init__ (self, service):
        self.service = service
    def getLayer(self, layername):    
        #try:
        if layername.find('idep') == 0:
            (blah, ltype, date) = layername.split("::", 3)
            uri = 'date=%s&year=%s&month=%s&day=%s' % (date, date[:4], 
                                                       date[5:7], date[8:10])
            layer = self.service.layers['idep']
            layer.name = layername
            layer.layers = ltype
            layer.url = "%s%s" % (layer.metadata['baseurl'], uri)
        elif layername.find("::") > 0:
            (sector,prod,tstring) = (layername.split("::")[1]).split('-')
            if len(tstring) == 12:
                mylayername = 'ridge-t'
                if sector in ['USCOMP',]:
                    mylayername = 'ridge-composite-t'
                    sector = sector.lower()
                    prod = prod.lower()
                year = tstring[:4]
                month = tstring[4:6]
                day = tstring[6:8]
                ts = tstring[8:12]
                uri = "year=%s&month=%s&day=%s&time=%s&" % (year, 
{'fraction_non_alphanumeric': 0.15670650730411687, 'fraction_numerical': 0.015139442231075698, 'mean_word_length': 2.162048698572628, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1193965', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1165, 'n_words': 264}