Changeset 3445

Show
Ignore:
Timestamp:
09/02/07 14:28:05 (1 year ago)
Author:
chrisz
Message:

Small simplification.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/TurboKid/trunk/turbokid/kidsupport.py

    r3429 r3445  
    183183 
    184184        if isinstance(format, str): 
    185             format = format.split()[:2] 
    186         elif isinstance(format, (tuple, list)): 
    187             format = format[:2] 
    188         else: 
     185            format = format.split() 
     186        elif not isinstance(format, (tuple, list)): 
    189187            format = (format,) 
    190         if len(format) == 2: 
    191             output, format = format 
    192         else: 
     188        if len(format) < 2: 
    193189            output, format = format[0], None 
    194190            if output.endswith('-straight'): 
    195191                # support old notation 'html-straight' instead of 'html straight' 
    196192                output, format = output[:-9], output[-8:] 
     193        else: 
     194            output, format = format[:2] 
    197195 
    198196        return t.serialize(encoding=self.defaultencoding, fragment=fragment,