Show More
@@ -143,7 +143,7 def staticfile(directory, fname, req): | |||||
143 | for part in parts: |
|
143 | for part in parts: | |
144 | if (part in ('', os.curdir, os.pardir) or |
|
144 | if (part in ('', os.curdir, os.pardir) or | |
145 | pycompat.ossep in part or |
|
145 | pycompat.ossep in part or | |
146 |
|
|
146 | pycompat.osaltsep is not None and pycompat.osaltsep in part): | |
147 | return |
|
147 | return | |
148 | fpath = os.path.join(*parts) |
|
148 | fpath = os.path.join(*parts) | |
149 | if isinstance(directory, str): |
|
149 | if isinstance(directory, str): |
@@ -1245,7 +1245,7 def stylemap(styles, paths=None): | |||||
1245 | if (not style |
|
1245 | if (not style | |
1246 | or style in (os.curdir, os.pardir) |
|
1246 | or style in (os.curdir, os.pardir) | |
1247 | or pycompat.ossep in style |
|
1247 | or pycompat.ossep in style | |
1248 |
or |
|
1248 | or pycompat.osaltsep and pycompat.osaltsep in style): | |
1249 | continue |
|
1249 | continue | |
1250 | locations = [os.path.join(style, 'map'), 'map-' + style] |
|
1250 | locations = [os.path.join(style, 'map'), 'map-' + style] | |
1251 | locations.append('map') |
|
1251 | locations.append('map') |
@@ -1304,8 +1304,8 def fspath(name, root): | |||||
1304 | return dict((normcase(n), n) for n in os.listdir(dir)) |
|
1304 | return dict((normcase(n), n) for n in os.listdir(dir)) | |
1305 |
|
1305 | |||
1306 | seps = pycompat.ossep |
|
1306 | seps = pycompat.ossep | |
1307 |
if |
|
1307 | if pycompat.osaltsep: | |
1308 |
seps = seps + |
|
1308 | seps = seps + pycompat.osaltsep | |
1309 | # Protect backslashes. This gets silly very quickly. |
|
1309 | # Protect backslashes. This gets silly very quickly. | |
1310 | seps.replace('\\','\\\\') |
|
1310 | seps.replace('\\','\\\\') | |
1311 | pattern = remod.compile(r'([^%s]+)|([%s]+)' % (seps, seps)) |
|
1311 | pattern = remod.compile(r'([^%s]+)|([%s]+)' % (seps, seps)) | |
@@ -1371,7 +1371,7 def checknlink(testfile): | |||||
1371 | def endswithsep(path): |
|
1371 | def endswithsep(path): | |
1372 | '''Check path ends with os.sep or os.altsep.''' |
|
1372 | '''Check path ends with os.sep or os.altsep.''' | |
1373 | return (path.endswith(pycompat.ossep) |
|
1373 | return (path.endswith(pycompat.ossep) | |
1374 |
or |
|
1374 | or pycompat.osaltsep and path.endswith(pycompat.osaltsep)) | |
1375 |
|
1375 | |||
1376 | def splitpath(path): |
|
1376 | def splitpath(path): | |
1377 | '''Split path by os.sep. |
|
1377 | '''Split path by os.sep. |
General Comments 0
You need to be logged in to leave comments.
Login now