File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Add public method ``map_in_to_out_file_path `` to ``Rule `` to allow for easier customization via inheritance.
Original file line number Diff line number Diff line change @@ -71,11 +71,14 @@ def _unasync_file(self, filepath):
7171 tokens = tokenize_rt .src_to_tokens (f .read ())
7272 tokens = self ._unasync_tokens (tokens )
7373 result = tokenize_rt .tokens_to_src (tokens )
74- outfilepath = filepath . replace ( self .fromdir , self . todir )
74+ outfilepath = self .map_in_to_out_file_path ( filepath )
7575 os .makedirs (os .path .dirname (outfilepath ), exist_ok = True )
7676 with open (outfilepath , "wb" ) as f :
7777 f .write (result .encode (encoding ))
7878
79+ def map_in_to_out_file_path (self , in_file_path ):
80+ return in_file_path .replace (self .fromdir , self .todir )
81+
7982 def _unasync_tokens (self , tokens ):
8083 skip_next = False
8184 for i , token in enumerate (tokens ):
You can’t perform that action at this time.
0 commit comments