Closed fbernhart closed 3 years ago
I think these should simply be deleted and integrated with the existing icon class. This would allow for a simpler API.
I just went ahead and tried switching them to methods of the Icon
class and it worked quite well. Let me know if you agree that this way is better. This, again, reduces dependence on the filesystem.
It seems like the three functions
get_xml()
,get_xml_bytes()
andget_str()
aren't working.Minimal reproducible example:
Throwing this error:
The same happens for
and
Looking at the
icon_xml.py
file, the error happens because you're trying to accesssimpleicons/icons/github.svg
. This might be working if you're testing your code locally and have your tests in the same directory, but it doesn't work while installing simpleicons as a package through pip. Becausesimpleicons/icons/github.svg
isn't located inside the current working directory (from where the script is called).I'm not very familiar with opening a file from within a package, but I gave it a few tries and came up with this solution. It should work by replacing
with
the same for the
get_str()
function.But let me know if you've got a better idea. 😊