def _record2card(self, record):
name = record['<STR_LIT:name>']<EOL>value = record['<STR_LIT:value>']<EOL>v_isstring = isstring(value)<EOL>if name == '<STR_LIT>':<EOL><INDENT>card = '<STR_LIT>' % value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>card = '<STR_LIT>' % value<EOL><DEDENT>elif name == '<STR_LIT>':<EOL><INDENT>card = '<STR_LIT>' % value<EOL><DEDENT>else:<EOL><INDENT>if len(name) > <NUM_LIT:8>:<EOL><INDENT>card = '<STR_LIT>' % name<EOL><DEDENT>else:<EOL><INDENT>card = '<STR_LIT>' % name[<NUM_LIT:0>:<NUM_LIT:8>]<EOL><DEDENT>if v_isstring:<EOL><INDENT>value = str(value)<EOL>if len(value) > <NUM_LIT:0>:<EOL><INDENT>if value[<NUM_LIT:0>] != "<STR_LIT:'>":<EOL><INDENT>value = "<STR_LIT:'>" + value + "<STR_LIT:'>"<EOL>vstr = '<STR_LIT>' % value<EOL><DEDENT>else:<EOL><INDENT>vstr = "<STR_LIT>" % value<EOL><DEDENT><DEDENT>else:<EOL><INDENT>vstr = "<STR_LIT>"<EOL><DEDENT><DEDENT>else:<EOL><INDENT>vstr = '<STR_LIT>' % value<EOL><DEDENT>card += vstr<EOL>if '<STR_LIT>' in record:<EOL><INDENT>card += '<STR_LIT>' % record['<STR_LIT>']<EOL><DEDENT><DEDENT>if v_isstring and len(card) > <NUM_LIT>:<EOL><INDENT>card = card[<NUM_LIT:0>:<NUM_LIT>] + "<STR_LIT:'>"<EOL><DEDENT>else:<EOL><INDENT>card = card[<NUM_LIT:0>:<NUM_LIT>]<EOL><DEDENT>return card<EOL>
when we add new records they don't have a card,
this sort of fakes it up similar to what cfitsio
does, just for display purposes.  e.g.

    DBL     =            23.299843
    LNG     =              3423432
    KEYSNC  = 'hello   '
    KEYSC   = 'hello   '           / a comment for string
    KEYDC   =     3.14159265358979 / a comment for pi
    KEYLC   =            323423432 / a comment for long

basically,
    - 8 chars, left aligned, for the keyword name
    - a space
    - 20 chars for value, left aligned for strings, right aligned for
      numbers
    - if there is a comment, one space followed by / then another space
      then the comment out to 80 chars