Package screenlets :: Package plugins :: Module Convert :: Class Converter
[hide private]
[frames] | no frames]

Class Converter

source code

Known Subclasses:
TemperatureConverter.TemperatureConverter, BaseConverter.BaseConverter, RatioConverter

The base class for the converters. The converters look after maintaining the list of currently shown values - initialising, accepting keyboard input, etc..

Instance Methods [hide private]
 
__init__(self) source code
 
on_key_press(self, key)
If accepted, appends the pressed key to the value in the currently active field.
source code
 
str(self, val) source code
 
neaten_input(self)
Replaces an empty value with '0' and again removes leading '0' in a non-empty string.
source code
 
filter_key(self, key)
Decides whether to accept pressed key.
source code
 
convert(self)
Recalculates field values after changes.
source code
Class Variables [hide private]
  __name__ = 'Converter'
  __title__ = 'Base'
  num_fields = 0
  field_names = []
  active_field = 0
  values = []
  replace = True