ufo-kit/concert — pull request #154 by matze (2013-11-20 16:10:48+00:00)
Title: [WIP] Replace Parameters with Parameter descriptors

Now that I know how descriptors work, I could finally tackle a problem that bugged me since we began this adventure. Until now, device writers have to instantiate `Parameter` objects and pass them up to the base `Parameterizable` class. This sucks from an elegance and implementation point of view.

This very-WIP-PR changes the way parameters are added to devices with a new meta class, a `ParameterValue` class that actually holds the current value, the `Parameter` descriptor that proxies to the `ParameterValue` and some magic :sparkles:

From an API point of view it looks now way more straightforward and removes some boiler plate with magic :sparkles: :

``` python
class SomeDevice(Device):

foo = Parameter(unit=q.s)

class ConcreteDevice(SomeDevice):
def __init__(self):
super(ConcreteDevice, self).__init__(self)

def _get_foo(self):
return 123 * q.s

def _set_foo(self, foo):
pass
```

So, what do we gain?

- The stub methods are not necessary anymore (but can be set!)
- It looks cleaner and very similar to what Django is doing
- We removed some horrible hackety-hack
- Most of the code didn't really change