Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

when using files it does not: #23

Open
alexsavio opened this issue Dec 7, 2015 · 4 comments
Open

when using files it does not: #23

alexsavio opened this issue Dec 7, 2015 · 4 comments

Comments

@alexsavio
Copy link
Contributor

When using files, Kaptan does not:

  • check for '.py' extension from the file argument or,
    • this could be helpful for: not having to define a handler, being able to input a real file path to import_config
  • check if the file is in the path of the interpreter or,
    • this could be helpful for: being able to import a config file wherever it is.
from kaptan import Kaptan
kp = Kaptan()
kp.import_config('config.py')
ImportError
from kaptan import Kaptan
kp = Kaptan(handler='file')
kp.import_config('config.py')
ImportError
from kaptan import Kaptan
kp = Kaptan(handler='file')
kp.import_config('/home/user/project/config.py')
ImportError
from kaptan import Kaptan
kp = Kaptan(handler='file')
cfg = kp.import_config('config')
@emre
Copy link
Owner

emre commented Dec 7, 2015

Feel free to send a PR :-)

Not sure I have time these days. +1 for the suggestions though. That's definetely a to-do.

@emre
Copy link
Owner

emre commented Dec 7, 2015

@tony do you have time for this? 👍

@alexsavio
Copy link
Contributor Author

Hi,

I have just done some kind of adapter here:
https://github.com/Neurita/pypes/blob/wip/pypes/config.py#L60

But I can send a PR soon if you agree with the issue.

@tony
Copy link
Collaborator

tony commented Dec 7, 2015

sounds like a good idea

@alexsavio I'm happy to review / QA if you want to PR it. Be sure to include tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants