3232
3333
3434def _is_github_symbolic_link (base_url : urllib .parse .ParseResult , contents : str ) -> bool :
35- """Look for remote path with contents that is a single line with no new
35+ """
36+ Test if link is a GitHub style symbolic link.
37+
38+ Look for remote path with contents that is a single line with no new
3639 line with an extension.
3740
3841 https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py
@@ -82,7 +85,7 @@ def bytes2str_in_dicts(
8285def load_linked_file (
8386 base_url : urllib .parse .ParseResult , link : str , is_import : bool = False
8487) -> Tuple [Any , urllib .parse .ParseResult ]:
85- """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py"""
88+ """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py . """
8689 new_url = resolved_path (base_url , link )
8790
8891 if new_url .scheme in ["file://" , "" ]:
@@ -123,7 +126,7 @@ def load_linked_file(
123126def normalize_to_map (
124127 obj : Union [List [Any ], Dict [str , Any ]], key_field : str
125128) -> Dict [str , Any ]:
126- """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py"""
129+ """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py . """
127130 if isinstance (obj , dict ):
128131 return deepcopy (obj )
129132 elif isinstance (obj , list ):
@@ -144,7 +147,7 @@ def normalize_to_map(
144147def normalize_to_list (
145148 obj : Union [List [Any ], Dict [str , Any ]], key_field : str , value_field : Optional [str ]
146149) -> List [Any ]:
147- """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py"""
150+ """From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py . """
148151 if isinstance (obj , list ):
149152 return deepcopy (obj )
150153 elif isinstance (obj , dict ):
@@ -165,14 +168,18 @@ def resolved_path(
165168 base_url : urllib .parse .ParseResult , link : str
166169) -> urllib .parse .ParseResult :
167170 """
168- Given a base_url ("this document") and a link ("string in this document")
169- return a new url (urllib.parse.ParseResult) that allows us to retrieve the
170- linked document. This function will
171+ Derive a resolved path.
172+
173+ This function will
171174 1. Resolve the path, which means dot and double dot components are resolved
172175 2. Use the OS appropriate path resolution for local paths, and network
173- appropriate resolution for network paths
176+ appropriate resolution for network paths
174177
175178 From https://github.com/rabix/sbpack/blob/b8404a0859ffcbe1edae6d8f934e51847b003320/sbpack/lib.py
179+
180+ :param base_url: "this document"
181+ :param link: "string in this document"
182+ :returns: new URL that allows us to retrieve the linked document
176183 """
177184 link_url = urllib .parse .urlparse (link )
178185 # The link will always Posix
0 commit comments