@@ -173,7 +173,9 @@ def parse_url(url):
173173
174174 Try to determine if the following is a file path or
175175 (as we will call anything else) a URL.
176+
176177 We return it slightly modified and combine the path parts.
178+
177179 We also assume if we see something like c:/ it is a Windows path.
178180 We don't bother checking if this **is** a Windows system, but
179181 'nix users really shouldn't be creating weird names like c: for their folder.
@@ -207,7 +209,7 @@ def parse_url(url):
207209 is_absolute = True
208210 elif RE_WIN_DRIVE_LETTER .match (scheme ):
209211 # c:/path
210- path = '/%s:%s' % (scheme , path .replace ('\\ ' , '/' ))
212+ path = '/{}:{}' . format (scheme , path .replace ('\\ ' , '/' ))
211213 scheme = 'file'
212214 netloc = ''
213215 is_absolute = True
@@ -218,7 +220,7 @@ def parse_url(url):
218220 netloc = ''
219221 is_absolute = True
220222 elif scheme != '' and netloc != '' :
221- # A non file path or strange URL
223+ # A non- file path or strange URL
222224 is_url = True
223225 elif path .startswith (('/' , '\\ ' )):
224226 # /root path
@@ -311,7 +313,7 @@ def on_navigate(self, event, obj=None):
311313 event .Veto ()
312314 # 'Nix systems treat "blank" (HTML string) pages as root paths most of the time.
313315 # So if we get `file:///` that is not empty and not linking to a target, we are
314- # Linking outside or page, but not to an external site.
316+ # Linking outside our page, but not to an external site.
315317 elif obj .content_type == HTML_STRING and not (url == 'file:///' or url .startswith ('file:///#' )):
316318 obj .busy = False
317319 event .Veto ()
0 commit comments