Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
2  wrw/session.py
@@ -19,7 +19,7 @@ class session(object):
19 19 def __init__(self, expire = 86400 * 7):
20 20 self.id = hexencode(gennonce(16))
21 21 self.dict = {}
22   - self.lock = threading.Lock()
  22 + self.lock = threading.RLock()
23 23 self.ctime = self.atime = self.mtime = int(time.time())
24 24 self.expire = expire
25 25 self.dctl = set()
4 wrw/sp/cons.py
@@ -9,6 +9,10 @@ class text(node, str):
9 9 def __todom__(self, doc):
10 10 return doc.createTextNode(self)
11 11
  12 +class raw(node, str):
  13 + def __todom__(self, doc):
  14 + raise Exception("Cannot convert raw code to DOM objects")
  15 +
12 16 class element(node):
13 17 def __init__(self, ns, name, ctx):
14 18 self.ns = ns
5 wrw/sp/util.py
@@ -44,6 +44,9 @@ def quotewrite(self, buf):
44 44 def text(self, el):
45 45 self.quotewrite(el)
46 46
  47 + def rawcode(self, el):
  48 + self.write(el)
  49 +
47 50 def attrval(self, buf):
48 51 qc, qt = ("'", "'") if '"' in buf else ('"', """)
49 52 self.write(qc)
@@ -112,6 +115,8 @@ def node(self, el):
112 115 self.element(el)
113 116 elif isinstance(el, cons.text):
114 117 self.text(el)
  118 + elif isinstance(el, cons.raw):
  119 + self.rawcode(el)
115 120 else:
116 121 raise Exception("Unknown object in element tree: " + el)
117 122
2  wrw/util.py
@@ -53,7 +53,7 @@ def get(cls, req, create = True):
53 53 except KeyError:
54 54 if not create:
55 55 return None
56   - ret = cls(req)
  56 + ret = cls(req, sess)
57 57 sess[cls] = ret
58 58 return ret
59 59

No commit comments for this range

Something went wrong with that request. Please try again.