We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e56590d commit fd718dcCopy full SHA for fd718dc
1 file changed
src/unasync/__init__.py
@@ -71,11 +71,14 @@ def _unasync_file(self, filepath):
71
tokens = tokenize_rt.src_to_tokens(f.read())
72
tokens = self._unasync_tokens(tokens)
73
result = tokenize_rt.tokens_to_src(tokens)
74
- outfilepath = filepath.replace(self.fromdir, self.todir)
+ outfilepath = self.map_in_to_out_file_path(filepath)
75
os.makedirs(os.path.dirname(outfilepath), exist_ok=True)
76
with open(outfilepath, "wb") as f:
77
f.write(result.encode(encoding))
78
79
+ def map_in_to_out_file_path(self, in_file_path):
80
+ return in_file_path.replace(self.fromdir, self.todir)
81
+
82
def _unasync_tokens(self, tokens):
83
skip_next = False
84
for i, token in enumerate(tokens):
0 commit comments