Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
# we abuse urlparse for our parsing needs
urlparse.uses_netloc.append("package")
class Property(object):
def __init__(self, klass, **kwargs):
self.klass = klass
self.kwargs = kwargs
self.__doc__ = kwargs.pop("help", None)
class Argument(ast.Pythonic, ast.Scalarish, ast.AST):
"""
Adds a property descriptor to a class that automatically validates and
resolves members of a yay AST node.
It is immutable.
"""
def __init__(self, resource, node, **kwargs):
super(Argument, self).__init__()
self.resource = resource
self.node = node
self.anchor = node.inner.anchor
self.parent = node.inner
self.default = kwargs.pop("default", '')
self.__doc__ = kwargs.pop("help", None)