diff --git a/pcbnew/dialogs/dialog_dimension_editor_base.cpp b/pcbnew/dialogs/dialog_dimension_editor_base.cpp index 96205bb8ca..105a3046f5 100644 --- a/pcbnew/dialogs/dialog_dimension_editor_base.cpp +++ b/pcbnew/dialogs/dialog_dimension_editor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 6 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -23,7 +23,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerMain->Add( m_staticTextDim, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_Name = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_Name->SetMaxLength( 0 ); m_Name->SetMinSize( wxSize( 400,-1 ) ); bSizerMain->Add( m_Name, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -39,7 +38,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerLeft->Add( m_staticTextSizeX, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_TxtSizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_TxtSizeXCtrl->SetMaxLength( 0 ); bSizerLeft->Add( m_TxtSizeXCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_staticTextSizeY = new wxStaticText( this, wxID_ANY, _("Text Height"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -47,7 +45,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerLeft->Add( m_staticTextSizeY, 0, wxRIGHT|wxLEFT, 5 ); m_TxtSizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_TxtSizeYCtrl->SetMaxLength( 0 ); bSizerLeft->Add( m_TxtSizeYCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_staticTextWidth = new wxStaticText( this, wxID_ANY, _("Text Thickness"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -55,7 +52,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerLeft->Add( m_staticTextWidth, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_TxtWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_TxtWidthCtrl->SetMaxLength( 0 ); bSizerLeft->Add( m_TxtWidthCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_staticTextPosX = new wxStaticText( this, wxID_ANY, _("Text Position X"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -63,7 +59,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerLeft->Add( m_staticTextPosX, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlPosX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlPosX->SetMaxLength( 0 ); bSizerLeft->Add( m_textCtrlPosX, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_staticTextPosY = new wxStaticText( this, wxID_ANY, _("Text Position Y"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -71,7 +66,6 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx bSizerLeft->Add( m_staticTextPosY, 0, wxRIGHT|wxLEFT, 5 ); m_textCtrlPosY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlPosY->SetMaxLength( 0 ); bSizerLeft->Add( m_textCtrlPosY, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -119,14 +113,12 @@ DIALOG_DIMENSION_EDITOR_BASE::DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wx this->Centre( wxBOTH ); // Connect Events - m_sdbSizerBtsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnCancelClick ), NULL, this ); m_sdbSizerBtsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this ); } DIALOG_DIMENSION_EDITOR_BASE::~DIALOG_DIMENSION_EDITOR_BASE() { // Disconnect Events - m_sdbSizerBtsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnCancelClick ), NULL, this ); m_sdbSizerBtsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DIMENSION_EDITOR_BASE::OnOKClick ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_dimension_editor_base.fbp b/pcbnew/dialogs/dialog_dimension_editor_base.fbp index 96e453c125..4324b7dedb 100644 --- a/pcbnew/dialogs/dialog_dimension_editor_base.fbp +++ b/pcbnew/dialogs/dialog_dimension_editor_base.fbp @@ -1532,7 +1532,7 @@ m_sdbSizerBts protected - OnCancelClick + diff --git a/pcbnew/dialogs/dialog_dimension_editor_base.h b/pcbnew/dialogs/dialog_dimension_editor_base.h index 6b03a0bb80..7c8e59b6c6 100644 --- a/pcbnew/dialogs/dialog_dimension_editor_base.h +++ b/pcbnew/dialogs/dialog_dimension_editor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 6 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -61,7 +61,6 @@ class DIALOG_DIMENSION_EDITOR_BASE : public DIALOG_SHIM wxButton* m_sdbSizerBtsCancel; // Virtual event handlers, overide them in your derived class - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dialogs/dialog_keepout_area_properties.cpp b/pcbnew/dialogs/dialog_keepout_area_properties.cpp index b0e08a2e7d..e9f4887008 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties.cpp +++ b/pcbnew/dialogs/dialog_keepout_area_properties.cpp @@ -69,8 +69,7 @@ private: */ void initDialog(); - void OnOkClick( wxCommandEvent& event ); - void OnCancelClick( wxCommandEvent& event ); + virtual void OnOkClick( wxCommandEvent& event ) override; /** * Function AcceptOptionsForKeepOut @@ -95,7 +94,10 @@ ZONE_EDIT_T InvokeKeepoutAreaEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSe { DIALOG_KEEPOUT_AREA_PROPERTIES dlg( aCaller, aSettings ); - ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() ); + ZONE_EDIT_T result = ZONE_ABORT; + + if( dlg.ShowModal() == wxID_OK ) + result = ZONE_OK; return result; } @@ -111,13 +113,10 @@ DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* m_ptr = aSettings; m_zonesettings = *aSettings; - SetReturnCode( ZONE_ABORT ); // Will be changed on button OK click - initDialog(); - m_sdbSizerButtonsOK->SetDefault(); - GetSizer()->SetSizeHints( this ); - Center(); + + FinishDialogSettings(); } @@ -185,18 +184,12 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog() } -void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( ZONE_ABORT ); -} - - void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event ) { if( AcceptOptionsForKeepOut() ) { *m_ptr = m_zonesettings; - EndModal( ZONE_OK ); + event.Skip(); // ends returning wxID_OK (default behavior) } } diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp index 0665261b29..19b3f38467 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 6 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -10,7 +10,6 @@ /////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE, DIALOG_SHIM ) - EVT_BUTTON( wxID_CANCEL, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnCancelClick ) EVT_BUTTON( wxID_OK, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnOkClick ) END_EVENT_TABLE() @@ -59,13 +58,13 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind wxStaticBoxSizer* sbSizerCutoutOpts; sbSizerCutoutOpts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Keepout Options:") ), wxVERTICAL ); - m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("No tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTracksCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No tracks"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No vias"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbViasCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No vias"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("No copper pour"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbCopperPourCtrl = new wxCheckBox( sbSizerCutoutOpts->GetStaticBox(), wxID_ANY, _("No copper pour"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp index 926ae8b818..e6a1a2fadc 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp @@ -583,6 +583,7 @@ sbSizerCutoutOpts wxVERTICAL + 1 none @@ -953,7 +954,7 @@ m_sdbSizerButtons protected - OnCancelClick + diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.h b/pcbnew/dialogs/dialog_keepout_area_properties_base.h index 3f38de5315..36f519474c 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.h +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jun 5 2014) +// C++ code generated with wxFormBuilder (version May 6 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -42,7 +42,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM private: // Private event handlers - void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } @@ -61,7 +60,6 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_sdbSizerButtonsCancel; // Virtual event handlers, overide them in your derived class - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index db08445634..1cf4e5c23d 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -6,9 +6,9 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr + * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -80,9 +80,9 @@ class DIALOG_DIMENSION_EDITOR : public DIALOG_DIMENSION_EDITOR_BASE { private: - PCB_EDIT_FRAME* m_Parent; + PCB_EDIT_FRAME* m_parent; wxDC* m_DC; - DIMENSION* CurrentDimension; + DIMENSION* m_currentDimension; public: @@ -94,8 +94,7 @@ public: private: - void OnCancelClick( wxCommandEvent& event ); - void OnOKClick( wxCommandEvent& event ); + virtual void OnOKClick( wxCommandEvent& event ) override; }; @@ -105,10 +104,10 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent, { SetFocus(); - m_Parent = aParent; + m_parent = aParent; m_DC = aDC; - CurrentDimension = aDimension; + m_currentDimension = aDimension; if( aDimension->Text().IsMirrored() ) m_rbMirror->SetSelection( 1 ); @@ -134,14 +133,14 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent, AddUnitSymbol( *m_staticTextPosY ); // Configure the layers list selector - if( !m_Parent->GetBoard()->IsLayerEnabled( aDimension->GetLayer() ) ) + if( !m_parent->GetBoard()->IsLayerEnabled( aDimension->GetLayer() ) ) // Should not happens, because one cannot select a board item on a // not activated layer, but ... m_SelLayerBox->ShowNonActivatedLayers( true ); m_SelLayerBox->SetLayersHotkeys( false ); m_SelLayerBox->SetLayerSet( LSET::AllCuMask().set( Edge_Cuts ) ); - m_SelLayerBox->SetBoardFrame( m_Parent ); + m_SelLayerBox->SetBoardFrame( m_parent ); m_SelLayerBox->Resync(); if( m_SelLayerBox->SetLayerSelection( aDimension->GetLayer() ) < 0 ) @@ -152,15 +151,11 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent, } m_sdbSizerBtsOK->SetDefault(); - GetSizer()->Fit( this ); - GetSizer()->SetSizeHints( this ); - Centre(); -} + FixOSXCancelButtonIssue(); -void DIALOG_DIMENSION_EDITOR::OnCancelClick( wxCommandEvent& event ) -{ - EndModal( -1 ); + // Now all widgets have the size fixed, call FinishDialogSettings + FinishDialogSettings(); } @@ -168,7 +163,7 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event ) { LAYER_ID newlayer = ToLAYER_ID( m_SelLayerBox->GetLayerSelection() ); - if( !m_Parent->GetBoard()->IsLayerEnabled( newlayer ) ) + if( !m_parent->GetBoard()->IsLayerEnabled( newlayer ) ) { wxMessageBox( _( "The layer currently selected is not enabled for this board\n" "You cannot use it" ) ); @@ -178,24 +173,24 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event ) #ifndef USE_WX_OVERLAY if( m_DC ) // Delete old text. { - CurrentDimension->Draw( m_Parent->GetCanvas(), m_DC, GR_XOR ); + m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_XOR ); } #endif - m_Parent->SaveCopyInUndoList(CurrentDimension, UR_CHANGED); + m_parent->SaveCopyInUndoList(m_currentDimension, UR_CHANGED); if( m_Name->GetValue() != wxEmptyString ) { - CurrentDimension->SetText( m_Name->GetValue() ); + m_currentDimension->SetText( m_Name->GetValue() ); } wxString msg; // Get new size value: msg = m_TxtSizeXCtrl->GetValue(); - CurrentDimension->Text().SetWidth( ValueFromString( g_UserUnit, msg ) ); + m_currentDimension->Text().SetWidth( ValueFromString( g_UserUnit, msg ) ); msg = m_TxtSizeYCtrl->GetValue(); - CurrentDimension->Text().SetHeight( ValueFromString( g_UserUnit, msg ) ); + m_currentDimension->Text().SetHeight( ValueFromString( g_UserUnit, msg ) ); // Get new position value: // It will be copied later in dimension, because @@ -204,12 +199,12 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event ) pos.x = ValueFromString( g_UserUnit, msg ); msg = m_textCtrlPosY->GetValue(); pos.y = ValueFromString( g_UserUnit, msg ); - CurrentDimension->Text().SetTextPosition( pos ); + m_currentDimension->Text().SetTextPosition( pos ); // Get new line thickness value: msg = m_TxtWidthCtrl->GetValue(); int width = ValueFromString( g_UserUnit, msg ); - int maxthickness = Clamp_Text_PenSize( width, CurrentDimension->Text().GetSize() ); + int maxthickness = Clamp_Text_PenSize( width, m_currentDimension->Text().GetSize() ); if( width > maxthickness ) { @@ -219,39 +214,39 @@ void DIALOG_DIMENSION_EDITOR::OnOKClick( wxCommandEvent& event ) width = maxthickness; } - CurrentDimension->SetWidth( width ); - CurrentDimension->Text().SetThickness( width ); - CurrentDimension->Text().SetMirrored( ( m_rbMirror->GetSelection() == 1 ) ? true : false ); - CurrentDimension->SetLayer( newlayer ); + m_currentDimension->SetWidth( width ); + m_currentDimension->Text().SetThickness( width ); + m_currentDimension->Text().SetMirrored( ( m_rbMirror->GetSelection() == 1 ) ? true : false ); + m_currentDimension->SetLayer( newlayer ); #ifndef USE_WX_OVERLAY if( m_DC ) // Display new text { - CurrentDimension->Draw( m_Parent->GetCanvas(), m_DC, GR_OR ); + m_currentDimension->Draw( m_parent->GetCanvas(), m_DC, GR_OR ); } #else - m_Parent->Refresh(); + m_parent->Refresh(); #endif - m_Parent->OnModify(); - EndModal( 1 ); + m_parent->OnModify(); + event.Skip(); // ends returning wxID_OK (default behavior) } static void AbortBuildDimension( EDA_DRAW_PANEL* Panel, wxDC* aDC ) { - DIMENSION* Dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem(); + DIMENSION* dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem(); - if( Dimension ) + if( dimension ) { - if( Dimension->IsNew() ) + if( dimension->IsNew() ) { - Dimension->Draw( Panel, aDC, GR_XOR ); - Dimension->DeleteStructure(); + dimension->Draw( Panel, aDC, GR_XOR ); + dimension->DeleteStructure(); } else { - Dimension->Draw( Panel, aDC, GR_OR ); + dimension->Draw( Panel, aDC, GR_OR ); } } @@ -359,9 +354,8 @@ void PCB_EDIT_FRAME::ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* a if( aDimension == NULL ) return; - DIALOG_DIMENSION_EDITOR* frame = new DIALOG_DIMENSION_EDITOR( this, aDimension, aDC ); - frame->ShowModal(); - frame->Destroy(); + DIALOG_DIMENSION_EDITOR dlg( this, aDimension, aDC ); + dlg.ShowModal(); } diff --git a/scripts/bom-in-python/bom_csv_grouped_by_value.py b/scripts/bom-in-python/bom_csv_grouped_by_value.py index f79c801243..4fa867202b 100644 --- a/scripts/bom-in-python/bom_csv_grouped_by_value.py +++ b/scripts/bom-in-python/bom_csv_grouped_by_value.py @@ -76,7 +76,7 @@ columnset = compfields | partfields # union columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset)) # Create a new csv writer object to use as the output formatter -out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_MINIMAL ) +out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_ALL ) # override csv.writer's writerow() to support encoding conversion (initial encoding is utf8): def writerow( acsvwriter, columns ):