src/eric7/Debugger/DebuggerInterfacePython.py

branch
eric7
changeset 11009
5206e4c572e8
parent 10985
91243eb0390d
child 11019
27cd57e98461
child 11029
1cd8701ed260
equal deleted inserted replaced
11008:a057b4f4ce73 11009:5206e4c572e8
9 9
10 import contextlib 10 import contextlib
11 import json 11 import json
12 import logging 12 import logging
13 import os 13 import os
14 import re
14 import shlex 15 import shlex
15 import struct 16 import struct
16 import time 17 import time
17 import zlib 18 import zlib
18 19
125 @type bool (optional) 126 @type bool (optional)
126 @return translated filename 127 @return translated filename
127 @rtype str 128 @rtype str
128 """ 129 """
129 if remote2local: 130 if remote2local:
130 path = fn.replace(self.translateRemote, self.translateLocal) 131 path = (
132 re.sub(
133 f"^{re.escape(self.translateRemote)}",
134 self.translateLocal,
135 fn,
136 flags=re.IGNORECASE,
137 )
138 if self.translateRemoteWindows
139 else fn.replace(self.translateRemote, self.translateLocal)
140 )
131 if self.translateLocalWindows: 141 if self.translateLocalWindows:
132 path = path.replace("/", "\\") 142 path = path.replace("/", "\\")
133 else: 143 else:
134 path = fn.replace(self.translateLocal, self.translateRemote) 144 path = (
145 re.sub(
146 f"^{re.escape(self.translateLocal)}",
147 self.translateRemote,
148 fn,
149 flags=re.IGNORECASE,
150 )
151 if self.translateLocalWindows
152 else fn.replace(self.translateLocal, self.translateRemote)
153 )
135 if not self.translateRemoteWindows: 154 if not self.translateRemoteWindows:
136 path = path.replace("\\", "/") 155 path = path.replace("\\", "/")
137 156
138 return path 157 return path
139 158

eric ide

mercurial