SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
List of all members
dialog.rule.ValueRule Class Reference

Some of this API is as it is for efficiency. More...

Inheritance diagram for dialog.rule.ValueRule:
dialog.rule.Rule dialog.rules.Always dialog.rules.Changed dialog.rules.Disable dialog.rules.MarkIf dialog.rules.Original dialog.rules.Validate dialog.rules.NotOriginal

Methods defined here:

def __getdisplay__
def __getname__
def __getvalid__
def __init__
def delete
def get_storage
def foo
def foo
def set_storage

Data descriptors defined here:

def display
def name
def valid

Methods inherited from Rule:

def __getdialog__
def __getenabled__
def __getobject__

Data descriptors inherited from Rule:

def __dict__
 dictionary for instance variables (if defined)
def __weakref__
 list of weak references to the object (if defined)
def dialog
def enabled
def object

Additional Inherited Members

- Public Member Functions inherited from dialog.rule.Rule

Detailed Description

Some of this API is as it is for efficiency.

Rules are a great example. Originally a rule instantiated itself on every model. Now it is simple told to set itself up on each one, then called when needed with the appropriate model.

To facilitate this we use "get_storage" to remember things from one run to the next, on a per model basis. [NOTE: remember, a model is an item being edited]

This meant huge memory savings in multi edit. It turns out that all of those closures got expensive!

Method resolution order

ValueRule
Rule
builtin.object

Constructor & Destructor Documentation

def dialog.rule.ValueRule.__init__ (   args)

Member Function Documentation

def dialog.rule.ValueRule.__dict__ (   args)
def dialog.rule.ValueRule.__getdialog__ (   args)
def dialog.rule.ValueRule.__getdisplay__ (   args)
def dialog.rule.ValueRule.__getenabled__ (   args)
def dialog.rule.ValueRule.__getname__ (   args)
def dialog.rule.ValueRule.__getobject__ (   args)
def dialog.rule.ValueRule.__getvalid__ (   args)
def dialog.rule.ValueRule.__weakref__ (   args)

list of weak references to the object (if defined)

Reimplemented from dialog.rule.Rule.

Reimplemented in dialog.rules.Validate, dialog.rules.Original, dialog.rules.NotOriginal, dialog.rules.MarkIf, dialog.rules.Disable, dialog.rules.Changed, and dialog.rules.Always.

def dialog.rule.ValueRule.delete (   args)
 You may override this function.
 This function is called when the rule is removed, often to
 be replaced by a quick call to new

Reimplemented in dialog.rules.Validate, dialog.rules.Original, dialog.rules.NotOriginal, dialog.rules.MarkIf, dialog.rules.Disable, dialog.rules.Changed, and dialog.rules.Always.

def dialog.rule.ValueRule.dialog (   args)
def dialog.rule.ValueRule.display (   args)
def dialog.rule.ValueRule.enabled (   args)
def dialog.rule.ValueRule.foo (   args)
 new = foo(args)
def dialog.rule.ValueRule.foo (   args)
 run = foo(args)
def dialog.rule.ValueRule.get_storage (   args)
 This is where you store your data if you need to store data between
 invocations of your rule.
 @param dat The item you're editing.
 
 @return a list.  You can put things into this list and they'll
         be there the next time you call get_storage
 
 @note This is a constant time function.

Reimplemented in dialog.rules.Validate, dialog.rules.Original, dialog.rules.NotOriginal, dialog.rules.MarkIf, dialog.rules.Disable, dialog.rules.Changed, and dialog.rules.Always.

def dialog.rule.ValueRule.name (   args)
def dialog.rule.ValueRule.object (   args)
def dialog.rule.ValueRule.set_storage (   args)
 You may prefer to override the default storage.
 Lists actually get pretty expensive, so if you modify
 your rule to use tuples (if you need to save multiple values)
 or the single value you need to save you'll save a lot of memory
 in multi edit.
 For the Change rule, this means 178 bytes per item instead of 242 bytes.

Reimplemented in dialog.rules.Validate, dialog.rules.Original, dialog.rules.NotOriginal, dialog.rules.MarkIf, dialog.rules.Disable, dialog.rules.Changed, and dialog.rules.Always.

def dialog.rule.ValueRule.valid (   args)