# Path: pale/arguments/string.py
# class StringArgument(BaseArgument):
#     allowed_types = (str, unicode)
#     min_length = None
#     max_length = None
# 
#     def validate(self, item, item_name):
#         if item is None:
#             # TODO: should we also set the default here if item is empty string?
#             item = self.default
# 
#         self._validate_type(item, item_name)
# 
#         if self.required is True and \
#                 (item is None or unicode(item) == ""):
#                 raise ArgumentError(item_name,
#                         ("This argument is required, and cannot be an empty "
#                          "string."))
#         if item is not None:
#             item = unicode(item)
#         return item
# 
# 
#     def doc_dict(self):
#         doc = super(StringArgument, self).doc_dict()
#         doc['min_length'] = self.min_length
#         doc['max_length'] = self.max_length
#         return doc
# 
# Path: pale/errors/validation.py
# class ArgumentError(BasePaleError):
#     def __init__(self, arg_name, message):
#         error_msg = ("Invalid argument: `%s`.  %s"
#                 % (arg_name, message))
#         self.arg_name = arg_name
#         super(ArgumentError, self).__init__(error_msg)


import string
import urlparse
from pale.arguments.string import StringArgument
from pale.errors import ArgumentError
from __future__ import absolute_import



class URLArgument(StringArgument):

    def __init__(self, *args, **kwargs):
        self.path_only = kwargs.pop('path_only', False)
        super(URLArgument, self).__init__(*args, **kwargs)


# Path: pale/arguments/string.py
# class StringArgument(BaseArgument):
#     allowed_types = (str, unicode)
#     min_length = None
#     max_length = None
# 
#     def validate(self, item, item_name):
#         if item is None:
#             # TODO: should we also set the default here if item is empty string?
#             item = self.default
# 
#         self._validate_type(item, item_name)
# 
#         if self.required is True and \
#                 (item is None or unicode(item) == ""):
#                 raise ArgumentError(item_name,
#                         ("This argument is required, and cannot be an empty "
#                          "string."))
#         if item is not None:
#             item = unicode(item)
#         return item
# 
# 
#     def doc_dict(self):
#         doc = super(StringArgument, self).doc_dict()
#         doc['min_length'] = self.min_length
#         doc['max_length'] = self.max_length
#         return doc
# 
# Path: pale/errors/validation.py
# class ArgumentError(BasePaleError):
#     def __init__(self, arg_name, message):
#         error_msg = ("Invalid argument: `%s`.  %s"
#                 % (arg_name, message))
#         self.arg_name = arg_name
#         super(ArgumentError, self).__init__(error_msg)


# Path: pale/arguments/url.py
import string
import urlparse
from pale.arguments.string import StringArgument
from pale.errors import ArgumentError

from __future__ import absolute_import



class URLArgument(StringArgument):

    def __init__(self, *args, **kwargs):
        self.path_only = kwargs.pop('path_only', False)
        super(URLArgument, self).__init__(*args, **kwargs)


    def validate_url(self, original_string):