Changeset 206

Show
Ignore:
Timestamp:
04/26/08 13:53:09 (9 months ago)
Author:
tal
Message:
Vanilla Cleanup Phase 4:

Quotes and whitespace.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • packages/vanilla/trunk/Lib/vanilla/__init__.py

    r170 r206  
    2525 
    2626__all__ = [ 
    27     'VanillaBaseObject', 'VanillaBaseControl', 'VanillaError'
    28     'Box', 'HorizontalLine', 'VerticalLine'
    29     'Button', 'SquareButton', 'ImageButton', 'HelpButton'
    30     'CheckBox'
    31     'ColorWell'
    32     'ComboBox'
    33     'Drawer'
    34     'EditText'
    35     'Group'
    36     'ImageView'
    37     'List', 'CheckBoxListCell', 'SliderListCell'
    38     'PopUpButton'
    39     'ProgressBar'
    40     'ProgressSpinner'
    41     'RadioGroup'
    42     'ScrollView'
    43     'SearchBox'
    44     'SecureEditText'
    45     'SegmentedButton'
    46     'Slider'
    47     'SplitView'
    48     'Tabs'
    49     'TextBox'
    50     'TextEditor'
    51     'Window', 'FloatingWindow', 'Sheet' 
     27    "VanillaBaseObject", "VanillaBaseControl", "VanillaError"
     28    "Box", "HorizontalLine", "VerticalLine"
     29    "Button", "SquareButton", "ImageButton", "HelpButton"
     30    "CheckBox"
     31    "ColorWell"
     32    "ComboBox"
     33    "Drawer"
     34    "EditText"
     35    "Group"
     36    "ImageView"
     37    "List", "CheckBoxListCell", "SliderListCell"
     38    "PopUpButton"
     39    "ProgressBar"
     40    "ProgressSpinner"
     41    "RadioGroup"
     42    "ScrollView"
     43    "SearchBox"
     44    "SecureEditText"
     45    "SegmentedButton"
     46    "Slider"
     47    "SplitView"
     48    "Tabs"
     49    "TextBox"
     50    "TextEditor"
     51    "Window", "FloatingWindow", "Sheet" 
    5252    ] 
    5353 
     
    5555try: 
    5656    from vanillaLevelIndicator import LevelIndicator, LevelIndicatorListCell 
    57     __all__.append('LevelIndicator'
    58     __all__.append('LevelIndicatorListCell'
     57    __all__.append("LevelIndicator"
     58    __all__.append("LevelIndicatorListCell"
    5959except (ImportError, NameError): 
    6060    pass 
     
    6363try: 
    6464    from vanillaGradientButton import GradientButton 
    65     __all__.append('GradientButton'
     65    __all__.append("GradientButton"
    6666except (ImportError, NameError): 
    6767    pass 
  • packages/vanilla/trunk/Lib/vanilla/dialogs.py

    r95 r206  
    1111 
    1212    def initWithMessageText_informativeText_alertStyle_buttonTitlesValues_window_resultCallback_(self, 
    13         messageText='', informativeText='', alertStyle=NSInformationalAlertStyle, buttonTitlesValues=[], parentWindow=None, resultCallback=None): 
     13        messageText="", informativeText="", alertStyle=NSInformationalAlertStyle, buttonTitlesValues=[], parentWindow=None, resultCallback=None): 
    1414 
    1515        self = super(BaseMessageDialog, self).init() 
     
    4949            self._resultCallback(self._value) 
    5050 
    51     alertDidEnd_returnCode_contextInfo_ = selector(alertDidEnd_returnCode_contextInfo_, signature='v@:@i@'
     51    alertDidEnd_returnCode_contextInfo_ = selector(alertDidEnd_returnCode_contextInfo_, signature="v@:@i@"
    5252 
    5353    def windowWillClose_(self, notification): 
     
    169169    return window 
    170170 
    171 def message(messageText='', informativeText='', alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
     171def message(messageText="", informativeText="", alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
    172172    parentWindow = _unwrapWindow(parentWindow) 
    173173    alert = BaseMessageDialog.alloc().initWithMessageText_informativeText_alertStyle_buttonTitlesValues_window_resultCallback_( 
     
    176176        return 1 
    177177 
    178 def askYesNoCancel(messageText='', informativeText='', alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
     178def askYesNoCancel(messageText="", informativeText="", alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
    179179    parentWindow = _unwrapWindow(parentWindow) 
    180180    alert = BaseMessageDialog.alloc().initWithMessageText_informativeText_alertStyle_buttonTitlesValues_window_resultCallback_( 
     
    183183        return alert._value 
    184184 
    185 def askYesNo(messageText='', informativeText='', alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
     185def askYesNo(messageText="", informativeText="", alertStyle=NSInformationalAlertStyle, parentWindow=None, resultCallback=None): 
    186186    parentWindow = _unwrapWindow(parentWindow) 
    187187    alert = BaseMessageDialog.alloc().initWithMessageText_informativeText_alertStyle_buttonTitlesValues_window_resultCallback_( 
  • packages/vanilla/trunk/Lib/vanilla/nsSubclasses.py

    r1 r206  
    2323_subclasses = {} 
    2424def getNSSubclass(classOrName=None): 
    25     """Return a subclass of a given Objective-C class. 
     25    """ 
     26    Return a subclass of a given Objective-C class. 
    2627    This subclass allows us to store a weakref to a Vanilla wrapper 
    2728    object. This way we can always get back at it. Mainly meant to 
  • packages/vanilla/trunk/Lib/vanilla/test/__init__.py

    r1 r206  
    1 # dir for vanilla tests. 
  • packages/vanilla/trunk/Lib/vanilla/test/testAll.py

    r1 r206  
    1010iconPath = os.path.join(vanillaPath, "Data", "testIcon.tif") 
    1111 
    12 sizeStyles = ['regular', 'small', 'mini'
     12sizeStyles = ["regular", "small", "mini"
    1313 
    1414listOptions = sys.modules.keys() 
     
    1717 
    1818class BaseTest(object): 
    19      
     19 
    2020    def drawGrid(self): 
    2121        w, h = self.w.getPosSize()[2:] 
     
    2424            if i == 0: 
    2525                continue 
    26             attrName = 'vline%d' % i 
     26            attrName = "vline%d" % i 
    2727            line = VerticalLine((increment*i, 0, 1, h)) 
    2828            setattr(self.w, attrName, line) 
     
    3030            if i == 0: 
    3131                continue 
    32             attrName = 'hline%d' % i 
     32            attrName = "hline%d" % i 
    3333            line = HorizontalLine((0, increment*i, w, 1)) 
    3434            setattr(self.w, attrName, line) 
    35      
     35 
    3636    def basicCallback(self, sender): 
    3737        print sender 
    38      
     38 
    3939    def titleCallback(self, sender): 
    4040        print sender, sender.getTitle() 
    41      
     41 
    4242    def getCallback(self, sender): 
    4343        print sender, sender.get() 
     
    4545 
    4646class WindowTest(BaseTest): 
    47      
     47 
    4848    def __init__(self, textured=False): 
    4949        self.textured = textured 
    50         self.w = Window((200, 130), 'Window Test', textured=textured) 
    51         self.w.windowButton = Button((10, 10, -10, 20), 'Window', callback=self.windowCallback) 
    52         self.w.sheetButton = Button((10, 40, -10, 20), 'Sheet', callback=self.sheetCallback) 
    53         self.w.drawerButton = Button((10, 70, -10, 20), 'Drawer', callback=self.drawerCallback) 
    54         self.w.floatButton = Button((10, 100, -10, 20), 'Floating Window', callback=self.floatCallback) 
    55         self.w.open() 
    56      
     50        self.w = Window((200, 130), "Window Test", textured=textured) 
     51        self.w.windowButton = Button((10, 10, -10, 20), "Window", callback=self.windowCallback) 
     52        self.w.sheetButton = Button((10, 40, -10, 20), "Sheet", callback=self.sheetCallback) 
     53        self.w.drawerButton = Button((10, 70, -10, 20), "Drawer", callback=self.drawerCallback) 
     54        self.w.floatButton = Button((10, 100, -10, 20), "Floating Window", callback=self.floatCallback) 
     55        self.w.open() 
     56 
    5757    def windowCallback(self, sender): 
    5858        WindowTest(not self.textured) 
    59      
     59 
    6060    def sheetCallback(self, sender): 
    6161        self.sheet = Sheet((300, 100), self.w) 
    62         self.sheet.closeButton = Button((10, -30, -10, 20), 'Close', callback=self._closeSheet) 
     62        self.sheet.closeButton = Button((10, -30, -10, 20), "Close", callback=self._closeSheet) 
    6363        self.sheet.open() 
    64      
     64 
    6565    def _closeSheet(self, sender): 
    6666        self.sheet.close() 
    6767        del self.sheet 
    68      
     68 
    6969    def drawerCallback(self, sender): 
    70         if not hasattr(self, 'drawer1'): 
    71             self.drawer1 = Drawer((50, 50), self.w, preferredEdge='left'
    72             self.drawer2 = Drawer((50, 50), self.w, preferredEdge='top'
    73             self.drawer3 = Drawer((50, 50), self.w, preferredEdge='right'
    74             self.drawer4 = Drawer((50, 50), self.w, preferredEdge='bottom'
     70        if not hasattr(self, "drawer1"): 
     71            self.drawer1 = Drawer((50, 50), self.w, preferredEdge="left"
     72            self.drawer2 = Drawer((50, 50), self.w, preferredEdge="top"
     73            self.drawer3 = Drawer((50, 50), self.w, preferredEdge="right"
     74            self.drawer4 = Drawer((50, 50), self.w, preferredEdge="bottom"
    7575        self.drawer1.toggle() 
    7676        self.drawer2.toggle() 
    7777        self.drawer3.toggle() 
    7878        self.drawer4.toggle() 
    79      
     79 
    8080    def floatCallback(self, sender): 
    8181        floater = FloatingWindow((100, 100)) 
     
    8484 
    8585class TextTest(BaseTest): 
    86      
    87     def __init__(self, drawGrid=False): 
    88         self.w = Window((440, 190), 'Text Test'
    89         # 
     86 
     87    def __init__(self, drawGrid=False): 
     88        self.w = Window((440, 190), "Text Test"
     89 
    9090        _top = 10 
    9191        top = _top 
    92         # 
    93         textSizeStyles = [('regular', 17), ('small', 14), ('mini', 11)] 
     92 
     93        textSizeStyles = [("regular", 17), ("small", 14), ("mini", 11)] 
    9494        for sizeStyle, height in textSizeStyles: 
    95             attrName = 'TextBox_%s' % sizeStyle 
     95            attrName = "TextBox_%s" % sizeStyle 
    9696            button = TextBox((10, top, 100, height), attrName, sizeStyle=sizeStyle) 
    9797            setattr(self.w, attrName, button) 
    9898            top += 30 
    99         # 
    100         textSizeStyles = [('regular', 22), ('small', 19), ('mini', 15)] 
     99 
     100        textSizeStyles = [("regular", 22), ("small", 19), ("mini", 15)] 
    101101        for sizeStyle, height in textSizeStyles: 
    102             attrName = 'SearchBox_%s' % sizeStyle 
     102            attrName = "SearchBox_%s" % sizeStyle 
    103103            button = SearchBox((10, top, 100, height), attrName, callback=self.getCallback, sizeStyle=sizeStyle) 
    104104            setattr(self.w, attrName, button) 
    105105            top += 30 
    106         # 
     106 
    107107        top = _top 
    108         textSizeStyles = [('regular', 22), ('small', 19), ('mini', 16)] 
     108        textSizeStyles = [("regular", 22), ("small", 19), ("mini", 16)] 
    109109        for sizeStyle, height in textSizeStyles: 
    110             attrName = 'EditText_%s' % sizeStyle 
     110            attrName = "EditText_%s" % sizeStyle 
    111111            button = EditText((120, top, 100, height), attrName, callback=self.getCallback, sizeStyle=sizeStyle) 
    112112            setattr(self.w, attrName, button) 
    113113            top += 30 
    114         # 
    115         textSizeStyles = [('regular', 21), ('small', 17), ('mini', 14)] 
     114 
     115        textSizeStyles = [("regular", 21), ("small", 17), ("mini", 14)] 
    116116        for sizeStyle, height in textSizeStyles: 
    117             attrName = 'ComboBox_%s' % sizeStyle 
     117            attrName = "ComboBox_%s" % sizeStyle 
    118118            button = ComboBox((120, top, 100, height), items=listOptions, callback=self.getCallback, sizeStyle=sizeStyle) 
    119119            setattr(self.w, attrName, button) 
    120120            top += 30 
    121         # 
     121 
    122122        self.w.TextEditor = TextEditor((240, 10, 190, 170), sys.copyright, callback=self.getCallback) 
    123         # 
     123 
    124124        if drawGrid: 
    125125            self.drawGrid() 
    126         # 
     126 
    127127        self.w.open() 
    128128 
    129129 
    130130class ButtonTest(BaseTest): 
    131      
    132     def __init__(self, drawGrid=False): 
    133         self.w = Window((440, 690), 'Button Test'
    134         # 
     131 
     132    def __init__(self, drawGrid=False): 
     133        self.w = Window((440, 690), "Button Test"
     134 
    135135        _top = 10 
    136136        top = _top 
    137         # 
    138         buttonSizeStyles = [('regular', 20), ('small', 17), ('mini', 14)] 
     137 
     138        buttonSizeStyles = [("regular", 20), ("small", 17), ("mini", 14)] 
    139139        for sizeStyle, height in buttonSizeStyles: 
    140             attrName = 'Button_%s' % sizeStyle 
     140            attrName = "Button_%s" % sizeStyle 
    141141            button = Button((10, top, 150, height), attrName, callback=self.titleCallback, sizeStyle=sizeStyle) 
    142142            setattr(self.w, attrName, button) 
    143143            top += 30 
    144         # 
     144 
    145145        height = 20 
    146146        for sizeStyle in sizeStyles: 
    147             attrName = 'SquareButton_%s' % sizeStyle 
     147            attrName = "SquareButton_%s" % sizeStyle 
    148148            button = SquareButton((10, top, 150, height), attrName, callback=self.titleCallback, sizeStyle=sizeStyle) 
    149149            setattr(self.w, attrName, button) 
    150150            top += 30 
    151         # 
    152         settings = [(None, False, 'top'), 
    153                     (None, True, 'top'), 
    154                     ('bop', True, 'top'), 
    155                     ('bop', True, 'bottom'), 
    156                     ('bop', True, 'left'), 
    157                     ('bop', True, 'right'),] 
     151 
     152        settings = [(None, False, "top"), 
     153                    (None, True, "top"), 
     154                    ("bop", True, "top"), 
     155                    ("bop", True, "bottom"), 
     156                    ("bop", True, "left"), 
     157                    ("bop", True, "right"),] 
    158158        for title, bordered, imagePosition in settings: 
    159             attrName = 'ImageButton_%s_%s_%s' % (title, bordered, imagePosition) 
     159            attrName = "ImageButton_%s_%s_%s" % (title, bordered, imagePosition) 
    160160            button = ImageButton((10, top, 150, 50), title=title, imagePath=iconPath, bordered=bordered, imagePosition=imagePosition, callback=self.basicCallback) 
    161161            setattr(self.w, attrName, button) 
    162162            top += 60 
    163         # 
    164         segmentedControlSizeStyles = [('regular', 20), ('small', 17), ('mini', 14)] 
    165         descriptions = [{'title':'One'}, {'title':'Two'}, {'title':'3', 'enabled':False}] 
     163 
     164        segmentedControlSizeStyles = [("regular", 20), ("small", 17), ("mini", 14)] 
     165        descriptions = [{"title":"One"}, {"title":"Two"}, {"title":"3", "enabled":False}] 
    166166        for sizeStyle, height in segmentedControlSizeStyles: 
    167             attrName = 'SegmentedControl_%s' % sizeStyle 
    168             button = SegmentedControl((10, top, 150, height), descriptions, callback=None, sizeStyle=sizeStyle) 
    169             setattr(self.w, attrName, button) 
    170             top += 30 
    171         # 
     167            attrName = "SegmentedButton_%s" % sizeStyle 
     168            button = SegmentedButton((10, top, 150, height), descriptions, callback=None, sizeStyle=sizeStyle) 
     169            setattr(self.w, attrName, button) 
     170            top += 30 
     171 
    172172        top = _top 
    173173        _left = 170 
    174174        left = _left 
    175175        height = 100 
    176         # 
    177         sliderSizeStyles = [('regular', 15), ('small', 11), ('mini', 10)] 
     176 
     177        sliderSizeStyles = [("regular", 15), ("small", 11), ("mini", 10)] 
    178178        for sizeStyle, width in sliderSizeStyles: 
    179             attrName = 'VSlider_noTicks_%s' % sizeStyle 
     179            attrName = "VSlider_noTicks_%s" % sizeStyle 
    180180            button = Slider((left, top, width, height), 0, 100, callback=self.getCallback, sizeStyle=sizeStyle) 
    181181            setattr(self.w, attrName, button) 
    182182            left += 30 
    183         sliderSizeStyles = [('regular', 23), ('small', 17), ('mini', 16)] 
     183        sliderSizeStyles = [("regular", 23), ("small", 17), ("mini", 16)] 
    184184        for sizeStyle, width in sliderSizeStyles: 
    185             attrName = 'VSlider_rightTicks_%s' % sizeStyle 
     185            attrName = "VSlider_rightTicks_%s" % sizeStyle 
    186186            button = Slider((left, top, width, height), 0, 100, tickMarkCount=10, callback=self.getCallback, sizeStyle=sizeStyle) 
    187187            setattr(self.w, attrName, button) 
    188188            left += 30 
    189189        for sizeStyle, width in sliderSizeStyles: 
    190             attrName = 'VSlider_leftTicks_%s' % sizeStyle 
     190            attrName = "VSlider_leftTicks_%s" % sizeStyle 
    191191            button = Slider((left, top, width, height), 0, 100, tickMarkCount=10, callback=self.getCallback, sizeStyle=sizeStyle) 
    192             button.setTickMarkPosition('left'
     192            button.setTickMarkPosition("left"
    193193            setattr(self.w, attrName, button) 
    194194            left += 30 
    195         # 
     195 
    196196        left = _left 
    197197        width = 260 
    198198        top = 130 
    199         sliderSizeStyles = [('regular', 15), ('small', 12), ('mini', 10)] 
     199        sliderSizeStyles = [("regular", 15), ("small", 12), ("mini", 10)] 
    200200        for sizeStyle, height in sliderSizeStyles: 
    201             attrName = 'HSlider_noTicks_%s' % sizeStyle 
     201            attrName = "HSlider_noTicks_%s" % sizeStyle 
    202202            button = Slider((left, top, width, height), 0, 100, callback=self.getCallback, sizeStyle=sizeStyle) 
    203203            setattr(self.w, attrName, button) 
    204204            top += 30 
    205         sliderSizeStyles = [('regular', 24), ('small', 17), ('mini', 16)] 
     205        sliderSizeStyles = [("regular", 24), ("small", 17), ("mini", 16)] 
    206206        for sizeStyle, height in sliderSizeStyles: 
    207             attrName = 'HSlider_belowTicks_%s' % sizeStyle 
     207            attrName = "HSlider_belowTicks_%s" % sizeStyle 
    208208            button = Slider((left, top, width, height), 0, 100, tickMarkCount=30, callback=self.getCallback, sizeStyle=sizeStyle) 
    209209            setattr(self.w, attrName, button) 
    210210            top += 30 
    211211        for sizeStyle, height in sliderSizeStyles: 
    212             attrName = 'HSlider_aboveTicks_%s' % sizeStyle 
     212            attrName = "HSlider_aboveTicks_%s" % sizeStyle 
    213213            button = Slider((left, top, width, height), 0, 100, tickMarkCount=30, callback=self.getCallback, sizeStyle=sizeStyle) 
    214             button.setTickMarkPosition('top'
    215             setattr(self.w, attrName, button) 
    216             top += 30 
    217         # 
     214            button.setTickMarkPosition("top"
     215            setattr(self.w, attrName, button) 
     216            top += 30 
     217 
    218218        _top = top 
    219         # 
    220         popupSizeStyles = [('regular', 20), ('small', 17), ('mini', 15)] 
     219 
     220        popupSizeStyles = [("regular", 20), ("small", 17), ("mini", 15)] 
    221221        width = 120 
    222222        for sizeStyle, height in popupSizeStyles: 
    223             attrName = 'PopUpButton_%s' % sizeStyle 
     223            attrName = "PopUpButton_%s" % sizeStyle 
    224224            button = PopUpButton((left, top, width, height), listOptions, callback=self.getCallback, sizeStyle=sizeStyle) 
    225225            setattr(self.w, attrName, button) 
    226226            top += 30 
    227         # 
     227 
    228228        top = _top 
    229         checkboxSizeStyles = [('regular', 22), ('small', 18), ('mini', 11)] 
     229        checkboxSizeStyles = [("regular", 22), ("small", 18), ("mini", 11)] 
    230230        width = 125 
    231231        left = 300 
    232232        for sizeStyle, height in popupSizeStyles: 
    233             attrName = 'CheckBox_%s' % sizeStyle 
     233            attrName = "CheckBox_%s" % sizeStyle 
    234234            button = CheckBox((left, top, width, height), attrName, callback=self.getCallback, sizeStyle=sizeStyle) 
    235235            setattr(self.w, attrName, button) 
    236236            top += 30 
    237         # 
     237 
    238238        # only add the ListIndicator tests if the controls are available 
    239239        try: 
    240240            _top = top 
    241             # 
     241 
    242242            left = _left 
    243243            width = 120 
    244             self.w.DLevelIndicator = LevelIndicator((left, top, width, 18), style='discrete'
     244            self.w.DLevelIndicator = LevelIndicator((left, top, width, 18), style="discrete"
    245245                        value=5, warningValue=7, criticalValue=9, 
    246246                        callback=self.getCallback) 
    247247            top += 30 
    248             self.w.DLevelIndicator_ticksAbove = LevelIndicator((left, top, width, 25), style='discrete'
     248            self.w.DLevelIndicator_ticksAbove = LevelIndicator((left, top, width, 25), style="discrete"
    249249                        value=5, warningValue=7, criticalValue=9, 
    250                         tickMarkPosition='above', minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
    251             top += 30 
    252             self.w.DLevelIndicator_ticksBelow = LevelIndicator((left, top, width, 25), style='discrete'
     250                        tickMarkPosition="above", minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
     251            top += 30 
     252            self.w.DLevelIndicator_ticksBelow = LevelIndicator((left, top, width, 25), style="discrete"
    253253                        value=5, warningValue=7, criticalValue=9, 
    254                         tickMarkPosition='below', minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
    255             # 
     254                        tickMarkPosition="below", minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
     255 
    256256            left = 300 
    257257            top = _top 
    258258            width = 120 
    259             self.w.CLevelIndicator = LevelIndicator((left, top, width, 16), style='continuous'
     259            self.w.CLevelIndicator = LevelIndicator((left, top, width, 16), style="continuous"
    260260                        value=5, warningValue=7, criticalValue=9, 
    261261                        callback=self.getCallback) 
    262262            top += 30 
    263             self.w.CLevelIndicator_ticksAbove = LevelIndicator((left, top, width, 23), style='continuous'
     263            self.w.CLevelIndicator_ticksAbove = LevelIndicator((left, top, width, 23), style="continuous"
    264264                        value=5, warningValue=7, criticalValue=9, 
    265                         tickMarkPosition='above', minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
    266             top += 30 
    267             self.w.CLevelIndicator_ticksBelow = LevelIndicator((left, top, width, 23), style='continuous'
     265                        tickMarkPosition="above", minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
     266            top += 30 
     267            self.w.CLevelIndicator_ticksBelow = LevelIndicator((left, top, width, 23), style="continuous"
    268268                        value=5, warningValue=7, criticalValue=9, 
    269                         tickMarkPosition='below', minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
     269                        tickMarkPosition="below", minorTickMarkCount=5, majorTickMarkCount=3, callback=self.getCallback) 
    270270        except NameError: 
    271271            pass 
    272         # 
     272 
    273273        if drawGrid: 
    274274            self.drawGrid() 
    275         # 
     275 
    276276        self.w.open() 
    277277 
    278278 
    279279class ListTest(BaseTest): 
    280      
    281     def __init__(self, drawGrid=False): 
    282         self.w = Window((440, 500), 'List Test', minSize=(400, 400)) 
    283         # 
     280 
     281    def __init__(self, drawGrid=False): 
     282        self.w = Window((440, 500), "List Test", minSize=(400, 400)) 
     283 
    284284        simpleList = List((0, 0, -0, 100), listOptions, enableTypingSensitivity=True) 
    285         # 
     285 
    286286        multiItems = [ 
    287             {'name': name, 'path': os.path.basename(getattr(module, '__file__', 'Unknown'))} 
     287            {"name": name, "path": os.path.basename(getattr(module, "__file__", "Unknown"))} 
    288288            for name, module in sys.modules.items() 
    289289        ] 
    290290        columnDescriptions = [ 
    291             {'title': 'Module Name', 'key': 'name'}, 
    292             {'title': 'File Name', 'key': 'path'
     291            {"title": "Module Name", "key": "name"}, 
     292            {"title": "File Name", "key": "path"
    293293        ] 
    294294        multiList = List((0, 110, -0, 100), multiItems, columnDescriptions=columnDescriptions, enableTypingSensitivity=True) 
    295295 
    296         # 
    297296        miscItems = [ 
    298             {'slider': 50, 'checkBox': False}, 
    299             {'slider': 20, 'checkBox': True}, 
    300             {'slider': 70, 'checkBox': False}, 
    301             {'slider': 20, 'checkBox': True}, 
    302             {'slider': 10, 'checkBox': True}, 
    303             {'slider': 90, 'checkBox': False}, 
     297            {"slider": 50, "checkBox": False}, 
     298            {"slider": 20, "checkBox": True}, 
     299            {"slider": 70, "checkBox": False}, 
     300            {"slider": 20, "checkBox": True}, 
     301            {"slider": 10, "checkBox": True}, 
     302            {"slider": 90, "checkBox": False}, 
    304303        ] 
    305304        columnDescriptions = [ 
    306             {'title': 'SliderListCell', 'key': 'slider'
    307             'cell': SliderListCell()}, 
    308             {'title': 'CheckBoxListCell', 'key': 'checkBox'
    309             'cell': CheckBoxListCell()}, 
     305            {"title": "SliderListCell", "key": "slider"
     306            "cell": SliderListCell()}, 
     307            {"title": "CheckBoxListCell", "key": "checkBox"
     308            "cell": CheckBoxListCell()}, 
    310309        ] 
    311310        miscCellList = List((0, 330, -0, 100), items=miscItems, columnDescriptions=columnDescriptions) 
     
    316315            dict(view=miscCellList), 
    317316        ] 
    318         # 
     317 
    319318        # only add the ListIndicator tests if the controls are available 
    320319        try: 
    321320            listIndicatorItems = [ 
    322                 {'discrete': 3, 'continuous': 4, 'rating': 1, 'relevancy': 9}, 
    323                 {'discrete': 8, 'continuous': 3, 'rating': 5, 'relevancy': 5}, 
    324                 {'discrete': 3, 'continuous': 7, 'rating': 3, 'relevancy': 4}, 
    325                 {'discrete': 2, 'continuous': 5, 'rating': 4, 'relevancy': 7}, 
    326                 {'discrete': 6, 'continuous': 9, 'rating': 3, 'relevancy': 2}, 
    327                 {'discrete': 4, 'continuous': 0, 'rating': 6, 'relevancy': 8}, 
     321                {"discrete": 3, "continuous": 4, "rating": 1, "relevancy": 9}, 
     322                {"discrete": 8, "continuous": 3, "rating": 5, "relevancy": 5}, 
     323                {"discrete": 3, "continuous": 7, "rating": 3, "relevancy": 4}, 
     324                {"discrete": 2, "continuous": 5, "rating": 4, "relevancy": 7}, 
     325                {"discrete": 6, "continuous": 9, "rating": 3, "relevancy": 2}, 
     326                {"discrete": 4, "continuous": 0, "rating": 6, "relevancy": 8}, 
    328327            ] 
    329328            columnDescriptions = [ 
    330                 {'title': 'discrete'
    331                 'cell': LevelIndicatorListCell(style='discrete', warningValue=7, criticalValue=9)}, 
    332                 {'title': 'continuous',  
    333                 'cell': LevelIndicatorListCell(style='continuous', warningValue=7, criticalValue=9)}, 
    334                 {'title': 'rating'
    335                 'cell': LevelIndicatorListCell(style='rating', maxValue=6)}, 
    336                 {'title': 'relevancy'
    337                 'cell': LevelIndicatorListCell(style='relevancy')}, 
     329                {"title": "discrete"
     330                "cell": LevelIndicatorListCell(style="discrete", warningValue=7, criticalValue=9)}, 
     331                {"title": "continuous",  
     332                "cell": LevelIndicatorListCell(style="continuous", warningValue=7, criticalValue=9)}, 
     333                {"title": "rating"
     334                "cell": LevelIndicatorListCell(style="rating", maxValue=6)}, 
     335                {"title": "relevancy"
     336                "cell": LevelIndicatorListCell(style="relevancy")}, 
    338337            ] 
    339338            levelIndicatorList = List((0, 220, -0, 100), items=listIndicatorItems, columnDescriptions=columnDescriptions) 
     
    343342 
    344343        self.w.splitView = SplitView((0, 0, -0, -0), paneDescriptions) 
    345         # 
    346         # 
     344 
    347345        if drawGrid: 
    348346            self.drawGrid() 
    349         # 
     347 
    350348        self.w.open() 
    351349 
    352350 
    353351class TestCustomNSView(NSView): 
    354      
     352 
    355353    def viewDidEndLiveResize(self): 
    356354        self._recalcSize() 
    357      
     355 
    358356    def _recalcSize(self): 
    359357        # XXX Note that this is specific for embedding in a ScrollView, 
     
    361359        w, h = self.superview().visibleRect()[1] 
    362360        self.setFrame_(((0, 0), (w, h))) 
    363      
     361 
    364362    def drawRect_(self, rect): 
    365363        if self.inLiveResize(): 
     
    381379 
    382380class ViewTest(BaseTest): 
    383      
    384     def __init__(self, drawGrid=False): 
    385         self.w = Window((450, 350), 'View Test', minSize=(350, 300)) 
    386         # 
    387         self.w.tabs = Tabs((10, 10, 220, 120), ['Small', 'Mini']) 
    388         self.w.tabs[0].tabs = Tabs((10, 10, -10, -10), ['One', 'Two', 'Three'], sizeStyle='small'
    389         self.w.tabs[1].tabs = Tabs((10, 10, -10, -10), ['One', 'Two', 'Three'], sizeStyle='mini'
    390         # 
    391         self.w.box = Box((10, 140, 220, 70), 'Box'
     381 
     382    def __init__(self, drawGrid=False): 
     383        self.w = Window((450, 350), "View Test", minSize=(350, 300)) 
     384 
     385        self.w.tabs = Tabs((10, 10, 220, 120), ["Small", "Mini"]) 
     386        self.w.tabs[0].tabs = Tabs((10, 10, -10, -10), ["One", "Two", "Three"], sizeStyle="small"
     387        self.w.tabs[1].tabs = Tabs((10, 10, -10, -10), ["One", "Two", "Three"], sizeStyle="mini"
     388 
     389        self.w.box = Box((10, 140, 220, 70), "Box"
    392390        self.w.box.box = Box((10, 10, -10, -10)) 
    393         # 
     391 
    394392        self.scrollViewNSView = TestCustomNSView.alloc().initWithFrame_(((0, 0), (500, 500))) 
    395393        self.w.scrollView = ScrollView((240, 10, 200, 200), self.scrollViewNSView, backgroundColor=NSColor.redColor()) 
    396         # 
     394 
    397395        self.splitViewNSView1 = TestCustomNSView.alloc().initWithFrame_(((0, 0), (0, 0))) 
    398396        self.splitViewNSView2 = TestCustomNSView.alloc().initWithFrame_(((0, 0), (0, 0))) 
     
    404402        ] 
    405403        self.w.splitView = SplitView((10, 220, -10, -10), paneDescriptions) 
    406         # 
     404 
    407405        if drawGrid: 
    408406            self.drawGrid() 
    409         # 
    410         self.w.open() 
     407 
     408        self.w.open() 
     409 
    411410 
    412411class ToolbarTest(BaseTest): 
    413      
    414     def __init__(self, drawGrid=False): 
    415         self.w = Window((350, 20), 'Toolbar Test', minSize=(250, 20)) 
    416         # 
     412 
     413    def __init__(self, drawGrid=False): 
     414        self.w = Window((350, 20), "Toolbar Test", minSize=(250, 20)) 
     415 
    417416        customView = NSSegmentedControl.alloc().initWithFrame_(((0, 0), (100, 30))) 
    418417        cell = customView.cell() 
     
    424423 
    425424        toolbarItems = [ 
    426             {'itemIdentifier': 'Test Item One'
    427              'label': 'Test One'
    428              'imagePath': iconPath, 
    429              'callback': self.basicCallback}, 
    430             {'itemIdentifier': 'Test Item Two'
    431              'label': 'Test Two'
    432              'imagePath': iconPath, 
    433              'callback': self.basicCallback}, 
    434             {'itemIdentifier': 'Test Item Three'
    435              'imagePath': iconPath, 
    436              'callback': self.basicCallback}, 
    437             {'itemIdentifier': 'Test Item Four'
    438              'label': 'Test Four'
    439              'view': customView, 
    440              'callback': self.basicCallback}, 
    441             {'itemIdentifier': NSToolbarPrintItemIdentifier, 'visibleByDefault': False}, 
    442             {'itemIdentifier': NSToolbarFlexibleSpaceItemIdentifier}, 
    443             {'itemIdentifier': NSToolbarCustomizeToolbarItemIdentifier}, 
    444         ] 
    445                           
    446         self.w.addToolbar('Vanilla Test Toolbar', toolbarItems=toolbarItems) 
    447         # 
     425            {"itemIdentifier": "Test Item One"
     426             "label": "Test One"
     427             "imagePath": iconPath, 
     428             "callback": self.basicCallback}, 
     429            {"itemIdentifier": "Test Item Two"
     430             "label": "Test Two"
     431             "imagePath": iconPath, 
     432             "callback": self.basicCallback}, 
     433            {"itemIdentifier": "Test Item Three"
     434             "imagePath": iconPath, 
     435             "callback": self.basicCallback}, 
     436            {"itemIdentifier": "Test Item Four"
     437             "label": "Test Four"
     438             "view": customView, 
     439             "callback": self.basicCallback}, 
     440            {"itemIdentifier": NSToolbarPrintItemIdentifier, "visibleByDefault": False}, 
     441            {"itemIdentifier": NSToolbarFlexibleSpaceItemIdentifier}, 
     442            {"itemIdentifier": NSToolbarCustomizeToolbarItemIdentifier}, 
     443        ] 
     444 
     445        self.w.addToolbar("Vanilla Test Toolbar", toolbarItems=toolbarItems) 
     446 
    448447        self.w.open() 
    449448 
    450449 
    451450class MiscTest(BaseTest): 
    452      
    453     def __init__(self, drawGrid=False): 
    454         self.w = Window((150, 180), 'Misc. Test'
    455         # 
    456         self.w.spinner1 = ProgressSpinner((10, 10, 32, 32), sizeStyle='regular'
    457         self.w.spinner2 = ProgressSpinner((50, 10, 16, 16), sizeStyle='small'
    458         # 
     451 
     452    def __init__(self, drawGrid=False): 
     453        self.w = Window((150, 180), "Misc. Test"
     454 
     455        self.w.spinner1 = ProgressSpinner((10, 10, 32, 32), sizeStyle="regular"
     456        self.w.spinner2 = ProgressSpinner((50, 10, 16, 16), sizeStyle="small"
     457 
    459458        self.w.bar1 = ProgressBar((10, 50, -10, 16)) 
    460         self.w.bar2 = ProgressBar((10, 70, -10, 10), isIndeterminate=True, sizeStyle='small'
    461         # 
    462         self.w.progressStartButton = Button((10, 90, -10, 20), 'Start Progress', callback=self.startProgress) 
    463         # 
     459        self.w.bar2 = ProgressBar((10, 70, -10, 10), isIndeterminate=True, sizeStyle="small"
     460 
     461        self.w.progressStartButton = Button((10, 90, -10, 20), "Start Progress", callback=self.startProgress) 
     462 
    464463        self.w.colorWell = ColorWell((10, 130, -10, -10), callback=self.getCallback, color=NSColor.redColor()) 
    465         # 
     464 
    466465        if drawGrid: 
    467466            self.drawGrid() 
    468         # 
    469         self.w.open() 
    470      
     467 
     468        self.w.open() 
     469 
    471470    def startProgress(self, sender): 
    472471        self.w.spinner1.start() 
     
    515514 
    516515class Test(object): 
    517      
     516 
    518517    def __init__(self): 
    519518        self.w = FloatingWindow((200, 300, 120, 310)) 
    520         self.w.drawGrid = CheckBox((10, 10, -10, 22), 'Draw Grid', value=False) 
    521         self.w.windows = Button((10, 40, -10, 20), 'Windows', callback=self.openTestCallback) 
    522         self.w.geometry = Button((10, 70, -10, 20), 'Geometry', callback=self.openTestCallback) 
    523         self.w.text = Button((10, 100, -10, 20), 'Text', callback=self.openTestCallback) 
    524         self.w.buttons = Button((10, 130, -10, 20), 'Buttons', callback=self.openTestCallback) 
    525         self.w.list = Button((10, 160, -10, 20), 'List', callback=self.openTestCallback) 
    526         self.w.view = Button((10, 190, -10, 20), 'Views', callback=self.openTestCallback) 
    527         self.w.toolbar = Button((10, 220, -10, 20), 'Toolbar', callback=self.openTestCallback) 
    528         self.w.misc = Button((10, 250, -10, 20), 'Misc.', callback=self.openTestCallback) 
    529         self.w.split = Button((10, 280, -10, 20), 'SplitView', callback=self.openTestCallback) 
    530         self.w.open() 
    531      
     519        self.w.drawGrid = CheckBox((10, 10, -10, 22), "Draw Grid", value=False) 
     520        self.w.windows = Button((10, 40, -10, 20), "Windows", callback=self.openTestCallback) 
     521        self.w.geometry = Button((10, 70, -10, 20), "Geometry", callback=self.openTestCallback) 
     522        self.w.text = Button((10, 100, -10, 20), "Text", callback=self.openTestCallback) 
     523        self.w.buttons = Button((10, 130, -10, 20), "Buttons", callback=self.openTestCallback) 
     524        self.w.list = Button((10, 160, -10, 20), "List", callback=self.openTestCallback) 
     525        self.w.view = Button((10, 190, -10, 20), "Views", callback=self.openTestCallback) 
     526        self.w.toolbar = Button((10, 220, -10, 20), "Toolbar", callback=self.openTestCallback) 
     527        self.w.misc = Button((10, 250, -10, 20), "Misc.", callback=self.openTestCallback) 
     528        self.w.split = Button((10, 280, -10, 20), "SplitView", callback=self.openTestCallback) 
     529        self.w.open() 
     530 
    532531    def openTestCallback(self, sender): 
    533532        title = sender.getTitle() 
    534         if title == 'Windows'
     533        if title == "Windows"
    535534            WindowTest() 
    536         elif title == 'Geometry'
     535        elif title == "Geometry"
    537536            from vanilla.test.testGeometry import TestGeometry 
    538537            TestGeometry() 
    539         elif title == 'Text'
     538        elif title == "Text"
    540539            TextTest(self.w.drawGrid.get()) 
    541         elif title == 'Buttons'
     540        elif title == "Buttons"
    542541            ButtonTest(self.w.drawGrid.get()) 
    543         elif title == 'List'
     542        elif title == "List"
    544543            ListTest(self.w.drawGrid.get()) 
    545         elif title == 'Views'
     544        elif title == "Views"
    546545            ViewTest(self.w.drawGrid.get()) 
    547         elif title == 'Toolbar'
     546        elif title == "Toolb