Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed a bunch of annoying trailing whitespace.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5068 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 535535a45e0a5a0d730b217cec1cba75ce18a948 1 parent 76005c9
@malcolmt malcolmt authored
View
2  django/utils/cache.py
@@ -86,7 +86,7 @@ def patch_response_headers(response, cache_timeout=None):
def add_never_cache_headers(response):
"""
- Add headers to a response to indicate that
+ Add headers to a response to indicate that
a page should never be cached.
"""
patch_response_headers(response, cache_timeout=-1)
View
12 django/utils/datastructures.py
@@ -16,9 +16,9 @@ def __getitem__(self, key):
def __contains__(self, key):
return self.has_key(key)
-
- def __copy__(self):
- return self.__class__(*self.dicts)
+
+ def __copy__(self):
+ return self.__class__(*self.dicts)
def get(self, key, default=None):
try:
@@ -45,9 +45,9 @@ def has_key(self, key):
if dict.has_key(key):
return True
return False
-
- def copy(self):
- """ returns a copy of this object"""
+
+ def copy(self):
+ """ returns a copy of this object"""
return self.__copy__()
class SortedDict(dict):
View
15 django/utils/synch.py
@@ -1,6 +1,6 @@
"""
Synchronization primitives:
-
+
- reader-writer lock (preference to writers)
(Contributed to Django by eugene@lazutkin.com)
@@ -14,17 +14,16 @@
class RWLock:
"""
Classic implementation of reader-writer lock with preference to writers.
-
+
Readers can access a resource simultaneously.
Writers get an exclusive access.
-
+
API is self-descriptive:
reader_enters()
reader_leaves()
writer_enters()
writer_leaves()
"""
-
def __init__(self):
self.mutex = threading.RLock()
self.can_read = threading.Semaphore(0)
@@ -33,7 +32,7 @@ def __init__(self):
self.active_writers = 0
self.waiting_readers = 0
self.waiting_writers = 0
-
+
def reader_enters(self):
self.mutex.acquire()
try:
@@ -45,7 +44,7 @@ def reader_enters(self):
finally:
self.mutex.release()
self.can_read.acquire()
-
+
def reader_leaves(self):
self.mutex.acquire()
try:
@@ -56,7 +55,7 @@ def reader_leaves(self):
self.can_write.release()
finally:
self.mutex.release()
-
+
def writer_enters(self):
self.mutex.acquire()
try:
@@ -68,7 +67,7 @@ def writer_enters(self):
finally:
self.mutex.release()
self.can_write.acquire()
-
+
def writer_leaves(self):
self.mutex.acquire()
try:
Please sign in to comment.
Something went wrong with that request. Please try again.