49 |
props[node] = prop |
props[node] = prop |
50 |
|
|
51 |
class Cmp(java.util.Comparator): |
class Cmp(java.util.Comparator): |
52 |
|
def __init__(self, get): self.get = get |
53 |
|
|
54 |
def compare(self, r1, r2): |
def compare(self, r1, r2): |
55 |
return [t,r,s,v,u,w].index(r1) - [t,r,s,v,u,w].index(r2) |
return [t,r,s,v,u,w].index(self.get(r1)) \ |
56 |
|
- [t,r,s,v,u,w].index(self.get(r2)) |
57 |
|
|
58 |
def testNullRotation(): |
def testNullRotation(): |
59 |
r.addProperty(p, s) |
r.addProperty(p, s) |
60 |
r.addProperty(p, t) |
r.addProperty(p, t) |
61 |
|
|
62 |
vs = getvs() |
vs = getvs() |
63 |
cursor = gzz.loom.Cursor(Cmp()) |
cursor = gzz.loom.Cursor(Cmp(lambda stmt: stmt.getSubject()), |
64 |
|
Cmp(lambda stmt: stmt.getObject())) |
65 |
cursor.set(r) |
cursor.set(r) |
66 |
view.render(vs, 0, cursor) |
view.render(vs, 0, cursor) |
67 |
|
|
86 |
w.addProperty(p, r) |
w.addProperty(p, r) |
87 |
|
|
88 |
vs = getvs() |
vs = getvs() |
89 |
cursor = gzz.loom.Cursor(Cmp(), r, 1, s) |
cursor = gzz.loom.Cursor(Cmp(lambda stmt: stmt.getSubject()), |
90 |
|
Cmp(lambda stmt: stmt.getObject()), |
91 |
|
r, 1, s) |
92 |
assert cursor.rotation == 0 |
assert cursor.rotation == 0 |
93 |
view.render(vs, 0, cursor) |
view.render(vs, 0, cursor) |
94 |
|
|