Commit 36babae5 authored by Andreas Jung's avatar Andreas Jung

striing module free zone

parent d891e363
...@@ -25,7 +25,6 @@ import Globals ...@@ -25,7 +25,6 @@ import Globals
from Globals import DTMLFile from Globals import DTMLFile
import urlparse, httplib import urlparse, httplib
from urllib import quote from urllib import quote
from string import lower, join, split
from App.Common import rfc1123_date from App.Common import rfc1123_date
...@@ -46,13 +45,13 @@ class AcceleratedHTTPCache (Cache): ...@@ -46,13 +45,13 @@ class AcceleratedHTTPCache (Cache):
phys_path = ob.getPhysicalPath() phys_path = ob.getPhysicalPath()
if self.hit_counts.has_key(phys_path): if self.hit_counts.has_key(phys_path):
del self.hit_counts[phys_path] del self.hit_counts[phys_path]
ob_path = quote(join(phys_path, '/')) ob_path = quote('/'.join(phys_path))
results = [] results = []
for url in self.notify_urls: for url in self.notify_urls:
if not url: if not url:
continue continue
# Send the PURGE request to each HTTP accelerator. # Send the PURGE request to each HTTP accelerator.
if lower(url[:7]) == 'http://': if url[:7].lower() == 'http://':
u = url u = url
else: else:
u = 'http://' + url u = 'http://' + url
...@@ -68,7 +67,7 @@ class AcceleratedHTTPCache (Cache): ...@@ -68,7 +67,7 @@ class AcceleratedHTTPCache (Cache):
errcode, errmsg, headers = h.getreply() errcode, errmsg, headers = h.getreply()
h.getfile().read() # Mandatory for httplib? h.getfile().read() # Mandatory for httplib?
results.append('%s %s' % (errcode, errmsg)) results.append('%s %s' % (errcode, errmsg))
return 'Server response(s): ' + join(results, ';') return 'Server response(s): ' + ';'.join(results)
def ZCache_get(self, ob, view_name, keywords, mtime_func, default): def ZCache_get(self, ob, view_name, keywords, mtime_func, default):
return default return default
...@@ -105,7 +104,7 @@ class AcceleratedHTTPCache (Cache): ...@@ -105,7 +104,7 @@ class AcceleratedHTTPCache (Cache):
caches = {} caches = {}
PRODUCT_DIR = split(__name__, '.')[-2] PRODUCT_DIR = __name__.split('.')[-2]
class AcceleratedHTTPCacheManager (CacheManager, SimpleItem): class AcceleratedHTTPCacheManager (CacheManager, SimpleItem):
' ' ' '
...@@ -193,7 +192,7 @@ class AcceleratedHTTPCacheManager (CacheManager, SimpleItem): ...@@ -193,7 +192,7 @@ class AcceleratedHTTPCacheManager (CacheManager, SimpleItem):
c = self.ZCacheManager_getCache() c = self.ZCacheManager_getCache()
rval = [] rval = []
for path, (anon, auth) in c.hit_counts.items(): for path, (anon, auth) in c.hit_counts.items():
rval.append({'path': join(path, '/'), rval.append({'path': '/'.join(path),
'anon': anon, 'anon': anon,
'auth': auth}) 'auth': auth})
if sort_by: if sort_by:
......
...@@ -24,7 +24,6 @@ from thread import allocate_lock ...@@ -24,7 +24,6 @@ from thread import allocate_lock
import time import time
import Globals import Globals
from Globals import DTMLFile from Globals import DTMLFile
from string import join, split
try: from cPickle import Pickler try: from cPickle import Pickler
except: from pickle import Pickler except: from pickle import Pickler
...@@ -246,7 +245,7 @@ class RAMCache (Cache): ...@@ -246,7 +245,7 @@ class RAMCache (Cache):
if view not in views: if view not in views:
views.append(view) views.append(view)
views.sort() views.sort()
info = {'path': join(oc.physical_path, '/'), info = {'path': '/'.join(oc.physical_path),
'hits': oc.hits, 'hits': oc.hits,
'misses': oc.misses, 'misses': oc.misses,
'size': size, 'size': size,
...@@ -320,7 +319,7 @@ class RAMCache (Cache): ...@@ -320,7 +319,7 @@ class RAMCache (Cache):
self.writelock.release() self.writelock.release()
caches = {} caches = {}
PRODUCT_DIR = split(__name__, '.')[-2] PRODUCT_DIR = __name__.split('.')[-2]
class RAMCacheManager (CacheManager, SimpleItem): class RAMCacheManager (CacheManager, SimpleItem):
' ' ' '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment