Changeset 1482

Show
Ignore:
Timestamp:
10/26/05 14:22:44 (3 years ago)
Author:
paul
Message:

Added a tools directory to the top-level dabo directory (alongside setup.py),
and added a script to the tools directory called reportMixedIndentation.py.
This script scans the directory tree, starting from where the script was
launched from, and reports on files and lines with mixed indentation, and
then gives you the opportunity to hand-edit each line in vim.

The rest of the changes are a first pass at fixing the indentation problems,
done while testing the reportMixedIndentation script.

Another item that may end up in this tools directory would be a checkConfig.py,
which people could run to get a list of failed dependencies or suggested
libraries to install.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dReportWriter.py

    r1423 r1482  
    6363                <align>"right"</align> 
    6464                <hAnchor>"right"</hAnchor> 
    65         <x>self.Bands["pageFooter"]["width"]-1</x> 
     65               <x>self.Bands["pageFooter"]["width"]-1</x> 
    6666                <y>"0 in"</y> 
    6767                <width>"6 in"</width> 
  • trunk/dabo/dSecurityManager.py

    r1423 r1482  
    1717            if attempt > 0: 
    1818                message = _("Login incorrect, please try again. (%s/%s)") % ( 
    19                             attempt+1, self.LoginAttemptsAllowed) 
     19                       attempt+1, self.LoginAttemptsAllowed) 
    2020            user, password = self.Application.uiApp.getLoginInfo(message) 
    2121 
  • trunk/dabo/lib/datanav/Page.py

    r1479 r1482  
    137137        if self.sortFields.has_key(self.sortDS): 
    138138            mn.append(_("Remove sort on ") + self.sortCap,  
    139                       bindfunc=self.handleSortRemove) 
     139                   bindfunc=self.handleSortRemove) 
    140140 
    141141        mn.append(_("Sort Ascending"), bindfunc=self.handleSortAsc) 
     
    348348            if typ == "char": 
    349349                chcList = [n_("Equals"),  
    350                        n_("Begins With"), 
    351                        n_("Contains") 
    352                        ] 
     350                        n_("Begins With"), 
     351                        n_("Contains")] 
    353352            elif typ == "memo": 
    354353                chcList = [n_("Begins With"), 
    355                        n_("Contains") 
    356                        ] 
     354                        n_("Contains")] 
    357355            if ws != "0": 
    358356                chcList.append(n_("Matches Words")) 
     
    360358        elif typ in ("date", "datetime"): 
    361359            chc = (n_("Equals"), 
    362                    n_("On or Before"), 
    363                    n_("On or After"), 
    364                    n_("Before"), 
    365                    n_("After") 
    366                    ) 
     360                    n_("On or Before"), 
     361                    n_("On or After"), 
     362                    n_("Before"), 
     363                    n_("After") ) 
    367364        elif typ in ("int", "float", "decimal"): 
    368365            chc = (n_("Equals"),  
    369                    n_("Greater than"), 
    370                    n_("Greater than/Equal to"), 
    371                    n_("Less than"), 
    372                    n_("Less than/Equal to") 
    373                    ) 
     366                    n_("Greater than"), 
     367                    n_("Greater than/Equal to"), 
     368                    n_("Less than"), 
     369                    n_("Less than/Equal to")) 
    374370        elif typ == "bool": 
    375371            chc = (CHOICE_TRUE, CHOICE_FALSE) 
  • trunk/dabo/lib/reporting_stefano/serialization/serialization.py

    r1044 r1482  
    33from children import * 
    44 
    5         
     5 
    66class SerializableMeta(type): 
    77    def __init__(cls, name, bases, dict): 
     
    1313        for name, obj in dict.items(): 
    1414            if (isinstance(obj, SerializableAttribute)  
    15                 or isinstance(obj, SerializableObjectChild)): 
     15                   or isinstance(obj, SerializableObjectChild)): 
    1616                attributes.append( (name, obj) ) 
    1717                delattr(cls, name) 
     
    2828        self.srcValues = {} 
    2929        attributeNames = [attrName for attrName,  
    30                           attrType in self._xmlSerializationAttributes] 
     30               attrType in self._xmlSerializationAttributes] 
    3131        for key, value in args.iteritems(): 
    3232            assert key in attributeNames, "Unknown attribute name %r for object %s" \ 
  • trunk/dabo/ui/dPemMixinBase.py

    r1423 r1482  
    8888                except AttributeError: 
    8989                    break 
    90                 if isinstance(parent, (dabo.ui.dForm, dabo.ui.dFormMain,  
    91                                        dabo.ui.dDialog) ): 
     90                if isinstance(parent, (dabo.ui.dFormMixin)): 
    9291                    frm = parent 
    9392                    break 
  • trunk/dabo/ui/uiwx/dGrid.py

    r1481 r1482  
    283283            if app is not None: 
    284284                width = app.getUserSetting("%s.%s.%s.%s" % (self.grid.Form.Name,  
    285                                                             self.grid.Name, colName,  
    286                                                             "Width")) 
     285                   self.grid.Name, colName,  
     286                  "Width")) 
    287287 
    288288            if width is None: 
     
    10141014            auto = self._autoHorizontalAlignment = True 
    10151015        mapping = {wx.ALIGN_LEFT: "Left", wx.ALIGN_RIGHT: "Right", 
    1016                  wx.ALIGN_CENTRE: "Center"} 
     1016               wx.ALIGN_CENTRE: "Center"} 
    10171017        wxAlignment = self._gridColAttr.GetAlignment()[0] 
    10181018        try: 
     
    10401040                self._autoHorizontalAlignment = False 
    10411041            mapping = {"Left": wx.ALIGN_LEFT, "Right": wx.ALIGN_RIGHT, 
    1042                     "Center": wx.ALIGN_CENTRE} 
     1042                    "Center": wx.ALIGN_CENTRE} 
    10431043            try: 
    10441044                wxHorAlign = mapping[val] 
     
    11181118    def _getVerticalAlignment(self): 
    11191119        mapping = {wx.ALIGN_TOP: "Top", wx.ALIGN_BOTTOM: "Bottom", 
    1120                  wx.ALIGN_CENTRE: "Center"} 
     1120               wx.ALIGN_CENTRE: "Center"} 
    11211121        wxAlignment = self._gridColAttr.GetAlignment()[1] 
    11221122        try: 
     
    11301130            val = self._expandPropStringValue(val, ("Top", "Bottom", "Center")) 
    11311131            mapping = {"Top": wx.ALIGN_TOP, "Bottom": wx.ALIGN_BOTTOM, 
    1132                     "Center": wx.ALIGN_CENTRE} 
     1132                    "Center": wx.ALIGN_CENTRE} 
    11331133            try: 
    11341134                wxVertAlign = mapping[val] 
     
    12201220                will be self.CustomEditorClass if set, or the default editor for the  
    12211221                datatype of the field.  (varies)""")) 
    1222    
     1222 
    12231223    DataField = property(_getDataField, _setDataField, None, 
    12241224            _("Field key in the data set to which this column is bound.  (str)") ) 
     
    13041304            self.CustomRendererClass if set, or the default renderer class for the  
    13051305            datatype of the field.  (varies)""")) 
    1306    
     1306 
    13071307    Searchable = property(_getSearchable, _setSearchable, None, 
    13081308            _("""Specifies whether this column's incremental search is enabled.  
     
    17241724                # Account for the width of the header caption: 
    17251725                cw = dabo.ui.fontMetricFromFont(colObj.Caption,  
    1726                                                 colObj.HeaderFont)[0] + capBuffer 
     1726                       colObj.HeaderFont)[0] + capBuffer 
    17271727                w = max(autoWidth, cw) 
    17281728                w = min(w, maxWidth) 
     
    18091809                    # Down arrow 
    18101810                    dc.DrawPolygon([(left, top), (left+self.sortIndicatorSize, top),  
    1811                                     (left+self.sortIndicatorBuffer, top+self.sortIndicatorSize)]) 
     1811                           (left+self.sortIndicatorBuffer, top+self.sortIndicatorSize)]) 
    18121812                elif self.sortOrder == "ASC": 
    18131813                    # Up arrow 
    18141814                    dc.DrawPolygon([(left+self.sortIndicatorBuffer, top),  
    1815                                     (left+self.sortIndicatorSize, top+self.sortIndicatorSize),  
    1816                                     (left, top+self.sortIndicatorSize)]) 
     1815                           (left+self.sortIndicatorSize, top+self.sortIndicatorSize),  
     1816                           (left, top+self.sortIndicatorSize)]) 
    18171817                else: 
    18181818                    # Column is not sorted, so don't draw. 
     
    18321832 
    18331833            wxah = {"Center": wx.ALIGN_CENTRE_HORIZONTAL,  
    1834                     "Left": wx.ALIGN_LEFT,  
    1835                     "Right": wx.ALIGN_RIGHT}[ah] 
     1834                   "Left": wx.ALIGN_LEFT,  
     1835                   "Right": wx.ALIGN_RIGHT}[ah] 
    18361836 
    18371837            wxav = {"Center": wx.ALIGN_CENTRE_VERTICAL,  
    1838                     "Top": wx.ALIGN_TOP, 
    1839                     "Bottom": wx.ALIGN_BOTTOM}[av] 
     1838                   "Top": wx.ALIGN_TOP, 
     1839                   "Bottom": wx.ALIGN_BOTTOM}[av] 
    18401840 
    18411841            # Give some more space around the rect - some platforms use a 3d look 
     
    23992399            self.autoSizeCol(self.getColByX(self._headerMousePosition[0]), persist=True) 
    24002400        menu.append(_("&Autosize Column"), bindfunc=_autosizeColumn,  
    2401                     help=_("Autosize the column based on the data in the column.")) 
     2401               help=_("Autosize the column based on the data in the column.")) 
    24022402 
    24032403        menu = self.fillHeaderContextMenu(menu) 
     
    29432943                if app is not None: 
    29442944                    app.setUserSetting("%s.%s.%s" % ( 
    2945                                        self.Form.Name, self.Name, "RowSize"), val) 
     2945                           self.Form.Name, self.Name, "RowSize"), val) 
    29462946        else: 
    29472947                self._properties["RowHeight"] = val 
     
    31503150    def initProperties(self): 
    31513151        self.DataSet = [{"name" : "Ed Leafe", "age" : 47, "coder" :  True, "color": "brown"}, 
    3152                         {"name" : "Mike Leafe", "age" : 18, "coder" :  False, "color": "purple"}, 
    3153                         {"name" : "Dan Leafe", "age" : 13, "coder" :  False, "color": "green"}] 
     3152               {"name" : "Mike Leafe", "age" : 18, "coder" :  False, "color": "purple"}, 
     3153               {"name" : "Dan Leafe", "age" : 13, "coder" :  False, "color": "green"}] 
    31543154        self.Width = 360 
    31553155        self.Height = 150 
  • trunk/dabo/ui/uiwx/dListControl.py

    r1415 r1482  
    1010 
    1111class dListControl(wx.ListCtrl, dcm.dControlItemMixin,  
    12                    ListMixin.ListCtrlAutoWidthMixin): 
     12       ListMixin.ListCtrlAutoWidthMixin): 
    1313    """ The List Control is ideal for visually dealing with data sets 
    1414    where each 'row' is a unit, where it doesn't make sense to deal