Guest User

Untitled

a guest
Jun 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class PathResolver(object):
  2.  
  3. @inject(config=interfaces.Config, path=interfaces.Path)
  4. def __init__(self, config=Injected, path=Injected):
  5. self.path = path
  6.  
  7. def __getattr__(self, name):
  8. return self.path('../ninjas/plugins')
  9.  
  10.  
  11.  
  12.  
  13.  
  14. class NinjaBinder(InstanceBinder):
  15.  
  16. def bind_path(self):
  17. from path import path
  18.  
  19. def Path(user_path):
  20. return path(user_path)
  21.  
  22. self.binder.bind(interfaces.Path, to_instance=Path)
Add Comment
Please, Sign In to add comment