File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,6 +283,24 @@ export class Python extends Writer<PythonGeneratorOptions> {
283283 return baseTypes ;
284284 }
285285
286+ private buildImportLine ( remaining : string [ ] , maxImportLineLength : number ) : string {
287+ let line = "" ;
288+ while ( remaining . length > 0 && line . length < maxImportLineLength ) {
289+ const entity = remaining . shift ( ) ;
290+ if ( ! entity ) throw new Error ( "Unexpected empty entity" ) ;
291+ if ( line . length > 0 ) {
292+ line += ", " ;
293+ }
294+ line += entity ;
295+ }
296+
297+ if ( remaining . length > 0 ) {
298+ line += ", \\" ;
299+ }
300+
301+ return line ;
302+ }
303+
286304 private importResources (
287305 fullPyPackageName : string ,
288306 importEmptyResources : boolean ,
Original file line number Diff line number Diff line change @@ -196,24 +196,4 @@ export abstract class Writer<T extends WriterOptions = WriterOptions> extends Fi
196196 this . deindent ( ) ;
197197 this . line ( `]${ endTokens ?. filter ( Boolean ) . join ( " " ) ?? "" } ` ) ;
198198 }
199-
200- // FIXME: python specific
201- buildImportLine ( remaining : string [ ] , maxImportLineLength : number ) : string {
202- let line = "" ;
203-
204- while ( remaining . length > 0 && line . length < maxImportLineLength ) {
205- const entity = remaining . shift ( ) ;
206- if ( ! entity ) throw new Error ( "Unexpected empty entity" ) ;
207- if ( line . length > 0 ) {
208- line += ", " ;
209- }
210- line += entity ;
211- }
212-
213- if ( remaining . length > 0 ) {
214- line += ", \\" ;
215- }
216-
217- return line ;
218- }
219199}
You can’t perform that action at this time.
0 commit comments