The PEAK Developers' Center   Diff for "EccoChemistry" UserPreferences
HelpContents Search Diffs Info Edit Subscribe XML Print View
Ignore changes in the amount of whitespace

Differences between version dated 2008-10-31 09:47:38 and 2010-03-22 18:17:32

Deletions are marked like this.
Additions are marked like this.

    >>> t4 = Task.serial.setdefault('Q22', "Another task", priority="Low")
    >>> t4.serial
    >>> t4.parent = t3 # Set parent item
    >>> t4.parent.text
    'Contemplate navel'
    >>> [t.text for t in t3.children] # Setting parent prepends to children
    ['Another task']
    >>> t3.children.prepend(t1) # Children have prepend/append methods
    >>> t3.children.append(t2)
    >>> [t.text for t in t3.children]
    ['Overhaul the whatzit', 'Another task', 'Upload this module to PyPI']
    >>> t4.children = t3.children # Can assign to an iterable of items
    >>> [t.text for t in t3.children] # item can't be its own child, so stays
    ['Another task']
    >>> [t.text for t in t4.children] # ...and the others get moved
    ['Overhaul the whatzit', 'Upload this module to PyPI']
    >>> t4.parent = None # setting parent to None makes it a top-level item
    >>> list(t3.children) # and removes it from the previous parent
    #>>> for t in Task.startswith("O"): print t.text
    Overhaul the whatzit
    #>>> for t in Task.with_text("e"): print t.text
    #>>> for t in Task.without_text("e"): print t.text
Please note a few important limitations:
* Mapping classes MUST NOT be defined until *after* the appropriate file is
* ``Item`` subclasses MUST NOT be defined until *after* the appropriate file is
  loaded in Ecco; i.e., your script must set up the Ecco connection **before**
  defining its classes! (You may wish to put your classes in a separate
  module, and delay its import until you .)
  defining its subclasses! (You may wish to put your subclasses in a separate
  module and delay its import until the connection is set up.)
* Parent/child traversal isn't supported (yet)
* Polymorphic types aren't supported (yet)
* All ``Item`` subclasses in a program must be defined against (and used with)
  exactly ONE open Ecco file during the program's runtime. Failure to adhere
  to this requirement may produce (possibly silent) data corruption and errors!
  (You can use generic ``Item`` and ``Folder`` instances with as many Ecco
  files as you wish, as long as you only use them while their corresponding
  Ecco file is open.)
* Date/time ranges are not currently supported and may cause errors
* You can't mix sorting and filtering, nor filter on more than one field
  (This may be improved in a future version.)
You can work around some of these limitations by appropriate use of the
Some operations not supported by EccoChemistry can still be performed via the
``Ecco`` singleton, which is an ``ecco_dde.EccoDDE`` instance. (See the
`EccoDDE developer's guide`_ for more information on its API.) "Item" and
"Folder" objects have ``id`` attributes that can be passed to the ``EccoDDE``
API, and you can also create items and folders using ids retrieved from the
``EccoDDE`` API::
    >>> Task(
    'Another task'
    >>> ec.CheckmarkFolder(ec.CheckmarkFolder('PhoneBook').id).name

    Upload this module to PyPI
    Contemplate navel
    >>> t5 = Task(t4)
    >>> t5.text
    'Another task'
    >>> t4.text = "Oops"
    >>> t5.text
Please consult the complete `EccoChemistry developer's guide`_ for more details.
Questions, comments, and bug reports for this package should be directed to the

* other query ops (==, !=, <=, >, >=, .startswith, .with_text, .without, -)
* writing to Item.text, Item(``**kw``), Item().update()
* Item(``**kw``), Item().update()
* value conversions, deleting values

* folder-type operations (e.g. ``for t in (aFolder[Task]=="X"):``)
Unimplemented Features:
* Polymorphic item/folder lookups (i.e., determine appropriate subtype when
  calling ``Folder(id)`` or ``SomeItemClass(id)``)
* Polymorphic item lookups (i.e., determine appropriate subtype when calling
  ``SomeItemClass(id)``) and upgrading
* Fast validity filtering (required fields + filter function over field names)

* ``Folder.__setitem__`` (e.g. ``aFolder[anItem] = value``)
* Folder parent/child info
Folder parent/child info::
    >>> f = ec.Folder('New Columns')
    >>> f.children
    [TextFolder('Net Location'),
     DateFolder('Recurring Note Dates'),
     NumericFolder('Effort Hours'),
     TextFolder('Task Serial #')]
    >>> f.parent
    CheckmarkFolder('Ecco Folders')
Internals and Tests
XXX Folders should be renameable or else .name should be read-only
    >>> Ecco.CloseFile(session)

ShowText of this page
EditText of this page
FindPage by browsing, title search , text search or an index
Or try one of these actions: AttachFile, DeletePage, LikePages, LocalSiteMap, SpellCheck