Kamaelia docs : Axon.util

General utility functions & common includes

Test documentation

Tests passed:

  • Finality - dummy class deriving from Exception - used for implementing try...finally in a generator.
  • axonRaise - behaviour depends on the value of production. If true it will simply return False. Otherwise it will throw an
  • listSubset - returns true if the first list argument is a subset of the second list argument.
  • logError - At the moment this function does nothing but can be rewritten to log ignored exception data. Equally the test does nothing.
  • production - is a module value that turns off some exception to make the system tolerant of failure when running in production.
  • removeAll - (xs:list,y) - removes all occurances of y from the list xs.
  • safeList - always returns a list even if the arg for constructing the list would normally cause a typeerror.
  • safeList - Like list it returns an empty list when called without an argument.
  • safeList - returns an empty list if the argument would cause a TypeError if passed to list(). That is anything without an iterator method.
  • In production mode failed tests will return false. Otherwise they will throw an exception that is likely to stop the system.
  • testInterface - returns true for a _minimal match_ on the interface of the component.

Axon.util.Finality

class Finality(Exception)

Used for implementing try...finally... inside a generator.

Axon.util.axonRaise

axonRaise(someException, *args)

Raises the supplied exception with the supplied arguments if Axon.util.production is set to True.

Axon.util.listSubset

listSubset(requiredList, suppliedList)

Returns true if the requiredList is a subset of the suppliedList.

Axon.util.logError

logError(someException, *args)

Currently does nothing but can be rewritten to log ignored errors if the production value is true.

Axon.util.removeAll

removeAll(xs, y)

Very simplistic method of removing all occurances of y in list xs.

Axon.util.safeList

safeList([arg])

Returns the list version of arg, otherwise returns an empty list.

Axon.util.testInterface

testInterface(theComponent, interface)

Look for a minimal match interface for the component. The interface should be a tuple of lists, i.e. ([inboxes],[outboxes]).

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 01 Feb 2010 at 04:00:28 UTC/GMT

 

Kamaelia is an open source project originated from and guided by BBC Research. For more information browse the site or get in contact.

This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)

(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved

This web site is powered by the same code created for the bicker manor project. For more details, contact Michael Sparks at BBC Research directly (cf contact)