# Path: statik/errors.py
# class ProjectConfigurationError(StatikError):
#     """For generic project configuration-related errors."""
#     error_kind = "Project configuration error"
#     exit_code = 2
# 
# class DeploymentError(StatikError):
#     """For errors relating to deployment of built projects."""
#     error_kind = "Deployment-related error"
#     exit_code = 9
# 
# Path: statik/deploy/base.py
# class DeploymentMethod(object):
#     """An abstract method for handling deployment."""
# 
#     def __init__(self, config, error_context=None):
#         """Must validate the given configuration for this deployment method and raise an exception
#         if it's invalid."""
#         raise NotImplementedError
# 
#     def execute(self, source_path):
#         """Must actually execute the implemented deployment method."""
#         raise NotImplementedError


import os
import os.path
import requests
import hashlib
import time
import json
import logging
from collections import OrderedDict, namedtuple
from datetime import datetime
from dateutil.parser import parse as dateutil_parse
from urllib.parse import quote as urllib_quote
from ..errors import ProjectConfigurationError, DeploymentError
from .base import DeploymentMethod
"""
Deployment support for Netlify (https://netlify.com).

This replaces the original Netlify support in Statik to reduce security concerns.
"""



logger = logging.getLogger(__name__)


ENVVAR_NETLIFY_SITE_ID = 'NETLIFY_SITE_ID'
ENVVAR_NETLIFY_AUTH_TOKEN = 'NETLIFY_AUTH_TOKEN'
NETLIFY_API_ROOT = 'https://api.netlify.com/api/v1'


DeploymentFile = namedtuple('DeploymentFile', ['path', 'url', 'sha1sum'])



# Path: statik/errors.py
# class ProjectConfigurationError(StatikError):
#     """For generic project configuration-related errors."""
#     error_kind = "Project configuration error"
#     exit_code = 2
# 
# class DeploymentError(StatikError):
#     """For errors relating to deployment of built projects."""
#     error_kind = "Deployment-related error"
#     exit_code = 9
# 
# Path: statik/deploy/base.py
# class DeploymentMethod(object):
#     """An abstract method for handling deployment."""
# 
#     def __init__(self, config, error_context=None):
#         """Must validate the given configuration for this deployment method and raise an exception
#         if it's invalid."""
#         raise NotImplementedError
# 
#     def execute(self, source_path):
#         """Must actually execute the implemented deployment method."""
#         raise NotImplementedError


# Path: statik/deploy/netlify.py
import os
import os.path
import requests
import hashlib
import time
import json
import logging
from collections import OrderedDict, namedtuple
from datetime import datetime
from dateutil.parser import parse as dateutil_parse
from urllib.parse import quote as urllib_quote
from ..errors import ProjectConfigurationError, DeploymentError
from .base import DeploymentMethod

"""
Deployment support for Netlify (https://netlify.com).

This replaces the original Netlify support in Statik to reduce security concerns.
"""



logger = logging.getLogger(__name__)


ENVVAR_NETLIFY_SITE_ID = 'NETLIFY_SITE_ID'
ENVVAR_NETLIFY_AUTH_TOKEN = 'NETLIFY_AUTH_TOKEN'
NETLIFY_API_ROOT = 'https://api.netlify.com/api/v1'


DeploymentFile = namedtuple('DeploymentFile', ['path', 'url', 'sha1sum'])



class Netlify(DeploymentMethod):