XavierWattermann / common

Commonly used Python methods
MIT License
2 stars 0 forks source link

`files_in_directory` does not always respect `return_full_path` #3

Closed lizzielizzielizzie closed 2 years ago

lizzielizzielizzie commented 2 years ago

Hi, I noticed that files_in_directory doesn't always return the full path even though the flag has been set - in particular, this seems to happen with files in .

>>> from xavi import common
>>> common.files_in_directory('.', return_full_path=True)
['./Gruntfile.js', './.sentryclirc', './.babelrc', './provision.sh', ... ]
>>>
XavierWattermann commented 2 years ago

Thank you for using xavi 🥺

This has been fixed in the latest version!! (https://pypi.org/project/xavi/0.5.0/)

Also, both arguments that you're using are the defaults, so you could just do:

>>> from xavi import common

>>> common.files_in_directory()  # also has an alias, "get_files"; common.get_files()

["/home/xavi/cow_pic_2021", "/home/xavi/solPoll.txt"]

pls consider giving me money on patreon 🤑