| ao.merseine.nu> |
and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Thu, 30 Jun, 05:20 |
| ao.merseine.nu> |
and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Thu, 30 Jun, 05:20 |
| chfeger |
cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Tue, 05 Oct, 13:38 |
| j..@best.com> |
old[2]<=col<old[3]++forrowinxrange(min(old[0],start_row),max(old[1],end_row)):+forcolinxrange(min(old[2],start_col),max(old[2],end_col)):+cell_in_new=in_new(row,col)+cell_in_old=in_old(row,col)++ifcell_in_newandnotcell_in_old:+keys.add((row,col))+elifcell_in_oldandnotcell_in_new:+keys.remove((row,col))++++classTableColumn(InteractionComponent):+defget_value(self,item):</ins> |
Sat, 26 Oct, 11:43 |
| sen |
n_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 26 Oct, 21:16 |
| y |
d(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 14 Jun, 16:51 |
| bk...@yahoo.com |
Column(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 23 Jan, 20:15 |
| bk...@yahoo.com |
Column(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 23 Jan, 20:15 |
| <mcfle...@rogers.com> |
end on the hour only line up |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
| <mcfle...@rogers.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Wed, 04 May, 01:07 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
|
="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Sun, 12 Jun, 00:34 |
| o |
hen&quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Tue, 30 Sep, 22:22 |
| mi...@kapor.com |
+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
w/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
w/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
w/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
eColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Mon, 27 Oct, 05:30 |
| mi...@kapor.com |
ÿÿ |
Mon, 27 Oct, 05:30 |
| k...@keefandjain.com |
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sun, 31 May, 00:29 |
| a |
lt;/span><span class="lines">@@ -240,7 +205,7 @@
</span><span class="cx"> @classmethod
</span><span class="cx"> def installed_on(cls, obj):
</span><span class="cx"> try:
</span><del>- obj = obj.__item
</del><ins>+ obj = obj._item
</ins><span class="cx"> except AttributeError:
</span><span class="cx"> pass
</span><span class="cx"> return isinstance(obj, Item) and cls in obj._extension_types
</span><span class="lines">@@ -258,6 +223,8 @@
</span><span class="cx"> if not isinstance(subject_item, Item):
</span><span class="cx"> raise TypeError, &quot;DashboardEntry's subject_item must be an Item&quot;
</span><span class="cx"> cells = trellis.Cells(subject_item)
</span><ins>+ # touch created in case it's a rule and doesn't yet exist
+ subject_item.created
</ins><span class="cx"> kw.setdefault(&quot;when&quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Wed, 01 May, 09:09 |
| <mwall...@allegroinfosystems.com> |
><spanclass="cx">kw.setdefault(&quot;when&quot;,cells[&quot;created&quot;])</span><spanclass="cx">kw.setdefault(&quot;what&quot;,cells[&quot;title&quot;])</span><spanclass="cx">super(DashboardEntry,self).__init__(**kw)</span></span></pre></div></div></body></html>> |
Wed, 05 Feb, 14:28 |
| <n...@3dsafety.com> |
cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sun, 05 Jun, 06:36 |
| <n...@3dsafety.com> |
07ad0@mail.student.math.uwaterloo.ca><7899.1035882266@www38.gmx.net> <7899.1035882266@www38.gmx.net><5.1.1.6.0.20021029072011.01c07ad0@mail.student.math.uwaterloo.ca> <5.1.1.6.2.20021029135610.023ecb38@shell3.shore.net> <1035934172.933.836.camel@fiawol> |
Sun, 05 Jun, 06:36 |
| <joelfin...@hotmail.com> |
end on the hour only line up |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
end on the hour only line up |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
> |
Tue, 26 Jul, 16:21 |
| <joelfin...@hotmail.com> |
et><5.1.1.6.0.20021029072011.01c07ad0@mail.student.math.uwaterloo.ca> <5.1.1.6.2.20021029135610.023ecb38@shell3.shore.net> <1035934172.933.836.camel@fiawol> |
Tue, 26 Jul, 16:21 |
| <ph...@TeamScope.com> |
except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Thu, 15 Sep, 05:33 |
| <wshatt...@wwdb.org> |
eturn self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sun, 23 Oct, 11:02 |
| <wshatt...@wwdb.org> |
eturn self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sun, 23 Oct, 11:02 |
| <ka...@ugcs.caltech.edu> |
ll_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Jan, 09:57 |
| <pcra...@yifan.net> |
except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Tue, 14 Feb, 14:14 |
| <pcra...@yifan.net> |
except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Tue, 14 Feb, 14:14 |
| bsi...@bellatlantic.net |
ndow/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
[No Subject] |
Sat, 07 Apr, 02:32 |
| bsi...@bellatlantic.net |
[No Subject] |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ndow/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| si...@mail.med.upenn.edu |
ableColumn(InteractionComponent):
+ def get_value(self, item):
</ins> |
Sat, 07 Apr, 02:32 |
| ovan |
mp;quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 13:15 |
| ovan |
mp;quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 13:15 |
| ovan |
mp;quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 13:15 |
| ovan |
mp;quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Sat, 07 Apr, 13:15 |
| <jfo...@freenet.de> |
gt;@@ -258,6 +223,8 @@
</span><span class="cx"> if not isinstance(subject_item, Item):
</span><span class="cx"> raise TypeError, &quot;DashboardEntry's subject_item must be an Item&quot;
</span><span class="cx"> cells = trellis.Cells(subject_item)
</span><ins>+ # touch created in case it's a rule and doesn't yet exist
+ subject_item.created
</ins><span class="cx"> kw.setdefault(&quot;when&quot;, cells[&quot;created&quot;])
</span><span class="cx"> kw.setdefault(&quot;what&quot;, cells[&quot;title&quot;])
</span><span class="cx"> super(DashboardEntry, self).__init__(**kw)
</span></span></pre>
</div>
</div>
</body>
</html>
><del>- def display_name(self, item):
- """Hook for customizing item display"""
</del><ins>+ def get_cell_value(self, (row, col)):
+ """Get value at (row, col) in the table"""
+ self.items.changes # introduce dependency?!?!
+ try:
+ item = self.items[row]
+ column = self.columns[col]
+ except IndexError:
+ return None
+ else:
+ return column.get_value(item)
+
+ visible_range_change = trellis.attr(resetting_to=(0, 0, 0, 0))
+
+ @trellis.maintain(initially=(0, 0, 0, 0))
+ def visible_ranges(self):
+ visible_ranges = tuple(old + delta
+ for old, delta in zip(self.visible_ranges,
+ self.visible_range_change))
+ if self.visible_ranges != visible_ranges:
+ self.set_visible_ranges(visible_ranges)
+ return visible_ranges
+
+ @trellis.make
+ def observer(self):
+ return collections.Observing(lookup_func=self.get_cell_value)
+
+ @trellis.modifier
+ def set_visible_ranges(self, (start_row, end_row, start_col, end_col)):
+ keys = self.observer.keys
+ old = self.visible_ranges
+
+ def in_new(row, col):
+ return start_row <= row < end_row and start_col <= col < end_col
+
+ def in_old(row, col):
+ return old[0] <= row < old[1] and old[2] <= col < old[3]
+
+ for row in xrange(min(old[0], start_row), max(old[1], end_row)):
+ for col in xrange(min(old[2], start_col), max(old[2], end_col)):
+ cell_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Thu, 05 Jul, 11:27 |
|
l_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Wed, 18 Jul, 08:37 |
|
l_in_new = in_new(row, col)
+ cell_in_old = in_old(row, col)
+
+ if cell_in_new and not cell_in_old:
+ keys.add((row, col))
+ elif cell_in_old and not cell_in_new:
+ keys.remove((row, col))
+
+
+
+class TableColumn(InteractionComponent):
+ def get_value(self, item):
</ins><span class="cx"> return unicode(item)
</span><span class="cx">
</span><del>-class _RuleCell(trellis.Cell):
- def get_value(self):
- return self.rule().get_value()
- def set_value(self, value):
- return self.rule().set_value(value)
- value = property(get_value, set_value)
</del><ins>+ def sort_key(self, item):
+ return self.get_value(item)
</ins><span class="cx">
</span><del>-class Scope(trellis.Component):
- model = trellis.attr(None)
- features = Many(inverse=Feature.scope)
</del><ins>+ trellis.attrs(
+ can_sort=True,
+ sort_ascending=False,
+ )
</ins><span class="cx">
</span><del>- def make_model_cell(self, attr):
- return _RuleCell(lambda: trellis.Cells(self.model)[attr])
</del><ins>+class Frame(Scope):
+ """A top-level window/dialog in the UI"""
+ pass
</ins><span class="cx">
</span><del>-
</del><span class="cx"> #### Utility #####
</span><span class="cx">
</span><span class="cx"> class Viewer(trellis.Component):
</span></span></pre>
</div>
</div>
</body>
</html>
|
Wed, 18 Jul, 08:37 |