Also replace empty strings with None during
hooke.util.convert._string_to_string() conversion to allow clearing
notes etc.
Also cleaned up docstrings in hooke.plugin.note to better reflect the
change made in commit
5e44aef4859c.
------------
You can take notes about the curves you are looking at. Just type
-``add_note`` followed by the text you want to append to that curve.
+``set_note`` followed by the text you want to attach to that curve.
Hooke will save the text in your current playlist and in an external
log file (TODO: no external file yet. Is this important?). The
output will look like this::
the target directory (here :file:`c:\curves\`) already exists before
doing that.
-If you change your mind about a note, you can remove it with
-``clear_note``.
+If you change your mind about a note, you can remove it by setting a
+blank note string with ``set_note ''``.
Exporting curves
----------------
class SetNoteCommand (Command):
- """Add a note to one of several Hooke objects.
+ """Set the note on one of several Hooke objects.
"""
def __init__(self, plugin):
super(SetNoteCommand, self).__init__(
class GetNoteCommand (Command):
- """Retrieve notes from one of several Hooke objects.
+ """Retrieve the note from one of several Hooke objects.
"""
def __init__(self, plugin):
super(GetNoteCommand, self).__init__(
"""Type conversion utilities.
"""
-CONVERT_FROM_STRING = {
- 'string': lambda x: x,
- 'bool': lambda x: x == 'True',
- 'int': lambda x: int(x),
- 'float': lambda x: float(x),
- }
-"""Functions converting strings to values, keyed by type.
-"""
ANALOGS = {
'file': 'string',
return fn(value)
def _string_to_string(value):
+ if len(value) == 0:
+ return None
return unicode(value)
def _string_to_bool(value):