;ò 7þÉ:c@sdkZdkZdklZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd fd „ƒYZd efd „ƒYZ de fd„ƒYZ defd„ƒYZ de fd„ƒYZ defd„ƒYZ defd„ƒYZedjoqgZgZxìeƒiƒD]ÛZeeƒeijo¿eeiƒZdZxXeeeƒjoDx3eeiD]$ZeejoeieƒqŒqŒWed7ZqkWxLeD]@Zeid gjo'eieƒeieiiƒƒqÊqÊWq7q7Weiƒeid„ƒdZ eei!ƒdjo†ei!ddjo5eei!dƒdjoei!ddiƒejoe"Z#ei!ddZ$n[eei!dƒdjoei!ddejo"ei!dZ#ei!ddZ$ndZ ei!ddjo5eei!d ƒdjoei!d diƒejoe"Z%ei!d dZ&qØeei!dƒdjoei!ddejo"ei!d Z%ei!ddZ&qØdZ ndZ e oWd!GHx9eD]1Z'd"Ge'iiƒGe'i(od#Ge'i(GnHqìWd$GHei)dƒne#e"jo ei*Z+nBye,e#d%ƒZ+Wn+e-j oZ.d&e#GHei)dƒnXe%e"jo ei/Z0nBye,e%d'ƒZ0Wn+e-j oZ.d(e%GHei)dƒnXx`eD]XZ'e'iiƒe$iƒjo e'ƒZ1ne'iiƒe&iƒjo e'ƒZ2qôqôWeƒZ3e3i4e+i5d)ƒe1ƒe0i6e3i7e2ƒƒndS(*N(sUserListsASVErrorcBstZRS(N(s__name__s __module__(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysASVError<ssMismatched_Field_Names_ErrorcBstZRS(N(s__name__s __module__(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysMismatched_Field_Names_Error=ssToo_Many_Fields_ErrorcBstZRS(N(s__name__s __module__(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysToo_Many_Fields_Error>ssASVcBsttZd„Zd„Zed„Zed„Zed„Zd„Zd„Z d„Z d „Z d „Z d „Z RS( NcCsti|ƒt|_dS(N(sUserLists__init__sselfsNones _field_names(sself((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys__init__Hs cCst|i||iƒSdS(s9Return row x as an instance of Row from this ASV instanceN(sRowsselfsdatasxs _field_names(sselfsx((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys __getitem__QscCs2|i||ƒ|id|i|<|id=dS(sìSet item x to row row can be either a Row instance or a list. field_names is a list of field names that each element in the row correnponds with and only makes sense if row is a list since a Row instance already has field namesiÿÿÿÿN(sselfsappendsrows field_namessdatasx(sselfsxsrows field_names((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys __setitem__ZscCs5t|tƒo|otdƒ‚nt|tƒp|o6t|tƒo|iƒ}n||ij o{t|ƒt|iƒjot dƒ‚nxL|D]@}y|ii |ƒWq¡t j ot d|ƒ‚q¡Xq¡Wng}xn|iD]c}|i|ƒdjp|i |ƒt|ƒjo|idƒqù|i||i |ƒƒqùW|ii|ƒn¾|itj ot|ƒt|iƒjo#td|t|iƒfƒ‚n|itj ot|ƒt|iƒjo2|ii|dgt|iƒt|ƒƒn|ii|ƒdS(súAppend row to this ASV instance row can be either a Row instance or a list. field_names is a list of field names that each element in the row correnponds with and only makes sense if row is a list since a Row instance already has field namessXCan't specify row of type Row and field_names since a Row object has its own field_namess-Too many field names from row to ASV instances$Field '%s' not found in ASV instanceissH'%s' contains more than the %s field names this ASV instance knows aboutN(s isinstancesrowsRows field_namessASVErrorsget_field_namessselfs _field_namesslensMismatched_Field_Names_Errors field_namesindexs ValueErrors row_as_listscountsappendsdatasNonesToo_Many_Fields_Error(sselfsrows field_namess row_as_lists field_name((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysappendks6 2,#,2cCs%x|D]}|i||ƒqWdS(s¥Append list rows to this ASV instance rows must be a list. Elements in rows should either all be Row instances or lists themselves; if this is not the case the result of the extend is undefined. row can be either a Row instance or a list. field_names is a list of field names that each element in the row correnponds with and only makes sense if row is a list since a Row instance already has field names.N(srowssxsselfsappends field_names(sselfsrowss field_namessx((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysextend³s cOs!t|i||f||ƒdS(s  Process input data using input_class Although the input_class can specify what type data should be, in general it should be a string. See 'input and output classes' in the main documentation for more discussion of what input_class should refer to. N(sapplys input_classsinputsselfsdatasargsskwargs(sselfsdatas input_classsargsskwargs((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysinputÄs cOsIt|dƒ}|idƒ}|iƒt|i||f||ƒdS(s¹ Process input data from a named file This is a convenience method. input_file should be the name of a readable file; see the input method for details of the other arguments srbiÿÿÿÿN( sopens input_filesfilesreadsdatasclosesapplysselfsinputs input_classsargsskwargs(sselfs input_files input_classsargsskwargssdatasfile((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysinput_from_fileÕs  cOst|i|f||ƒSdS(s+ Create output data using output_class N(sapplys output_classsoutputsselfsargsskwargs(sselfs output_classsargsskwargs((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysoutputæscOsFt|i|f||ƒ}t|dƒ}|i |ƒ|i ƒdS(sb Output data straight to a named file This is a convenience method for the output method swbN( sapplysselfsoutputs output_classsargsskwargssopens output_filesfileswritesclose(sselfs output_files output_classsargsskwargssfilesoutput((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysoutput_to_fileñs  cCsT|itj otdƒ‚nt|iƒdjotdƒ‚n||_dS(s% Set the field names for this ASV instance field_names must be a list of strings. You can not set field names if you they have already been set (either explicitly be using this method or indirectly by another method such as input) or if this ASV instance already holds data. s'Field names can not be changed once setis<Field names can not be set once data has already been storedN(sselfs _field_namessNonesASVErrorslensdatas field_names(sselfs field_names((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysset_field_namess cCs$|itjotSn |iSdS(sp Return this ASV instances field names Returns None if this ASV instance does not have any field names N(sselfs _field_namessNone(sself((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysget_field_namess(s__name__s __module__s__init__s __getitem__sNones __setitem__sappendsextendsinputsinput_from_filesoutputsoutput_to_filesset_field_namessget_field_names(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysASVEs  H     sSimpleSVcBs•tZddgZdgZddddgZdgZd ZdZdZd Z d d d „Z d „Z d „Z d„Z dd d d„Zd„ZRS(Ns"s's\s s s s s#iicCs¿| o|otdƒ‚ng} d}t|ƒ}g} |} xý||joï|i ||ƒ}d}x¢|i D]—}t|ƒtijoo|i||ƒoXxJ||jo<|i||ƒ}||jo|} }Pn|d7}q§Wd}Pq qutdƒ‚quW|oqFnx?|iD].}|i||ƒo|t|ƒ7}Pq(q(Wt}g} x||jod}xz|iD]o} |i| |ƒoV|d|jo| i| ƒ|d7}n | i||dƒ|d7}d}Pq†q†W|oqin|o|i||ƒoâ|t|ƒ7}|io||jo|i||ƒo$| i|ƒ|t|ƒ7}qin|i ||ƒ}xj||jo\|i||ƒ}||joPn|i||ƒ}||jo |}Pn|d7}q”WPn| o.|i||ƒ}||jo |}Pq9n|i||ƒ}||joPn| i||ƒ|d7}qiW| o.| iƒ| |i | dƒ} | iƒn| idi | ƒƒ|i||ƒ}||jp ||joI|i || |!dƒ|| jo| i| ƒng} |} }qFqFW|od| d}| d} |o|i#| ƒq»|i$ƒtjo|i%|ƒn|i#| |ƒn|i#| ƒdS(Ns>remove_field_names makes no sense if has_field_names is not oniisUnsupported comment typeis(&shas_field_namessremove_field_namessASVErrorsrowssinput_data_posslens input_datasinput_data_lensrowsinput_data_start_of_line_possselfs_skip_whitespacesstripped_a_comments _COMMENTSscommentstypestypess StringTypes startswiths _skip_newlinesinput_data_new_poss _SPEECH_MARKSs speech_marksNonesitemsescaped_a_chars _ESCAPE_CHARSs escape_charsappends_DOUBLE_SPEECH_IS_ESCAPEs_skip_seperatorsreversesjoins field_namessasvsextendsget_field_namessset_field_names(sselfsasvs input_datashas_field_namessremove_field_namesscommentsinput_data_new_poss speech_marksstripped_a_commentsinput_data_start_of_line_poss escape_charsrowsrowssitemsescaped_a_charsinput_data_lens field_namessinput_data_pos((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysinput6s             *        $  cCsAx6|t|ƒjo|||ijo|d7}qW|SdS(Ni(sinput_data_posslens input_datasselfs _WHITESPACE(sselfs input_datasinput_data_pos((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys_skip_whitespaceõs'cCsDx9|iD].}|i||ƒo|t|ƒ7}Pq q W|SdS(N(sselfs _NEWLINESsnewlines input_datas startswithsinput_data_posslen(sselfs input_datasinput_data_possnewline((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys _skip_newlineÿs   cCsDx9|iD].}|i||ƒo|t|ƒ7}Pq q W|SdS(N(sselfs _SEPERATORSs seperators input_datas startswithsinput_data_posslen(sselfs input_datasinput_data_poss seperator((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys_skip_seperator s   cCs½g}|iƒtj oL|i|i|iƒ||ƒƒ|i|ƒ| o|i|ƒqenx7|D]/}|i|i|||ƒƒ|i|ƒqlW|i|ƒdi |ƒSdS(Ns( soutputsasvsget_field_namessNonesappendsselfs_construct_lineskeep_it_simplesquotes_around_everythingsnewlinesrowsjoin(sselfsasvsnewlineskeep_it_simplesquotes_around_everythingsoutputsrow((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysoutputs"  cCscg}x|D]}x'|iD]}|i||dƒ}qW|io)|i|id|i|ifƒ}n4x0|i D]%}|i|d|i |fƒ}qzW|pB|i ƒ|jp/|i|iƒdjp|i|iƒdjo$|id|i||ifƒq |i|ƒq W|od|idi|ƒSnd|idi|ƒSdS(Nis%s%siÿÿÿÿs%s%s%ss%sis%s (s output_itemssitemssitemsselfs _ESCAPE_CHARSs escape_charsreplaces%_OUTPUT_DOUBLE_SPEECH_CHAR_FOR_ESCAPEs_OUTPUT_SPEECH_CHARs _SPEECH_MARKSs speech_marks_OUTPUT_ESCAPE_CHARsquotes_around_everythingsstripsfinds_OUTPUT_SEPERATORsappendskeep_it_simplesjoin(sselfsitemsskeep_it_simplesquotes_around_everythings speech_marksitems escape_chars output_items((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys_construct_line0s"  ) #L$(s__name__s __module__s _SPEECH_MARKSs _ESCAPE_CHARSs _NEWLINESs _COMMENTSs_DOUBLE_SPEECH_IS_ESCAPEs_OUTPUT_ESCAPE_CHARs_OUTPUT_SPEECH_CHARs%_OUTPUT_DOUBLE_SPEECH_CHAR_FOR_ESCAPEsinputs_skip_whitespaces _skip_newlines_skip_seperatorsoutputs_construct_line(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysSimpleSV(s   ¿ sCSVcBs#tZdZdgZdZdZRS(s%Standard CSV (Comma Seperated Values)s,s (s__name__s __module__s__doc__s _SEPERATORSs _WHITESPACEs_OUTPUT_SEPERATOR(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysCSVPs  sWinCSVcBstZdZdZRS(skAs standard CSV, but outputs speech characters as "" rather than \" for compatability with Windows programsi(s__name__s __module__s__doc__s%_OUTPUT_DOUBLE_SPEECH_CHAR_FOR_ESCAPE(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysWinCSV_s sTSVcBs,tZdZdgZdZdZd„ZRS(s#Standard TSV (Tab Seperated Values)s s cCsvg}x.|D]&}x'|iD]}|i||dƒ}qW|io)|i|id|i|ifƒ}n4x0|i D]%}|i|d|i |fƒ}qzW|pU|i ƒ|jpB|i|iƒdjp)|i|iƒdjp|i ƒdjo$|id|i||ifƒq |i|ƒq W|od|idi|ƒSnd|idi|ƒSdS( Nis%s%siÿÿÿÿss%s%s%ss%sis%s (s output_itemssitemssitemsselfs _ESCAPE_CHARSs escape_charsreplaces%_OUTPUT_DOUBLE_SPEECH_CHAR_FOR_ESCAPEs_OUTPUT_SPEECH_CHARs _SPEECH_MARKSs speech_marks_OUTPUT_ESCAPE_CHARsquotes_around_everythingsstripsfinds_OUTPUT_SEPERATORsappendskeep_it_simplesjoin(sselfsitemsskeep_it_simplesquotes_around_everythings speech_marksitems escape_chars output_items((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys_construct_lineus"   ) #_$(s__name__s __module__s__doc__s _SEPERATORSs _WHITESPACEs_OUTPUT_SEPERATORs_construct_line(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysTSVis  sWinTSVcBstZdZdZRS(skAs standard TSV, but outputs speech characters as "" rather than \" for compatability with Windows programsi(s__name__s __module__s__doc__s%_OUTPUT_DOUBLE_SPEECH_CHAR_FOR_ESCAPE(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysWinTSV˜s sColonSVcBs#tZdZdgZdZdZRS(sColon Seperated Valuess;s (s__name__s __module__s__doc__s _SEPERATORSs _WHITESPACEs_OUTPUT_SEPERATOR(((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pysColonSV¡s  sRowcBs8tZed„Zd„Zd„Zd„Zd„ZRS(NcCs||_||_dS(N(sitemssselfsdatas field_namess _field_names(sselfsitemss field_names((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys__init__²s cCs@t|ƒtijo|i|Sn|i|ii|ƒSdS(N(stypesxstypessIntTypesselfsdatas _field_namessindex(sselfsx((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys __getitem__ºscCsHt|ƒtijo|i||jn||i|ii|ƒsis-ciiisrasv [-c] - [] [-c] - [] Possible builders are: s s:sÒ -c can be used instead of the input/output file name to enable reading from stdin/stdout. Example: asv -tsv old_data.tsv -c -csv Will read in a TSV file, convert it to CSV and output the result to screensrbs$Unable to open file '%s' for readingswbs$Unable to open file '%s' for writingiÿÿÿÿ(8ssysstypessUserLists ExceptionsASVErrorsMismatched_Field_Names_ErrorsToo_Many_Fields_ErrorsASVsSimpleSVsCSVsWinCSVsTSVsWinTSVsColonSVsRows__name__sbuilderss builder_namessglobalssvaluessthingstypes ClassTypeslists __bases__s super_classesssuper_classes_posslens super_classsappendslowerssortshas_valid_argumentssargvsNonesinput_file_namesinput_builder_namesoutput_file_namesoutput_builder_namesbuilders__doc__sexitsstdins input_filesopensIOErrorsesstdouts output_files input_buildersoutput_buildersasvsinputsreadswritesoutput( soutput_builder_namesinput_builder_namesColonSVsToo_Many_Fields_Errors super_classsTSVsASVErrorsASVs output_files super_classessUserListsinput_file_nameshas_valid_argumentssasvs input_filessyssSimpleSVsWinTSVsoutput_file_namesCSVstypessMismatched_Field_Names_Errors input_buildersWinCSVsbuildersoutput_buildersthings builder_namesssuper_classes_possbuilderssesRow((s6/mnt/gmirror/ports/textproc/py-asv/work/asv-0.4/ASV.pys?4sª ãÿ) / 6   & L2 L2