# Path: ddserver/utils/deps.py
# def require(**requirements):
#   ''' Decorator to inject requirements into a function.
# 
#       The decorated function is called with a named argument for each
#       specified requirement containing the exported instances.
#   '''
# 
#   exports = {name : Export.load(requirement)
#              for name, requirement
#              in requirements.iteritems()}
# 
#   def wrapper(func):
#     def wrapped(*args, **kwargs):
#       # Update the keyword arguments with the required instances
#       kwargs.update({name : export.instance
#                      for name, export
#                      in exports.iteritems()
#                      if name not in kwargs})
# 
#       return func(*args,
#                   **kwargs)
# 
#     wrapped.__name__ = func.__name__
# 
#     return wrapped
#   return wrapper


import functools
import bottle
import formencode
from passlib.apps import custom_app_context as pwd
from ddserver.utils.deps import require
from ddserver.web import route
      responses.append(resp_abuse())
      continue

    # Update the host entry
    with db.cursor() as cur:
      cur.execute('''
          UPDATE `hosts`
          SET `address` = %(address)s,
              `updated` = CURRENT_TIMESTAMP
          WHERE `id` = %(id)s
      ''', {'id': host['id'],
            'address': address})

    logger.info('updater: Host entry updated: %s = %s', hostname, address)

    responses.append(resp_good(value=address))

  return responses


@route('/nic/ip', method='GET')
def get_ip():
  """ Return the IP address of the client extracted from
      the HTTP header.
  """

  return bottle.request.remote_addr


@route('/nic/update', method='GET')

# Path: ddserver/utils/deps.py
# def require(**requirements):
#   ''' Decorator to inject requirements into a function.
# 
#       The decorated function is called with a named argument for each
#       specified requirement containing the exported instances.
#   '''
# 
#   exports = {name : Export.load(requirement)
#              for name, requirement
#              in requirements.iteritems()}
# 
#   def wrapper(func):
#     def wrapped(*args, **kwargs):
#       # Update the keyword arguments with the required instances
#       kwargs.update({name : export.instance
#                      for name, export
#                      in exports.iteritems()
#                      if name not in kwargs})
# 
#       return func(*args,
#                   **kwargs)
# 
#     wrapped.__name__ = func.__name__
# 
#     return wrapped
#   return wrapper


# Path: ddserver/updater/nic.py
import functools
import bottle
import formencode
from passlib.apps import custom_app_context as pwd
from ddserver.utils.deps import require
from ddserver.web import route

      responses.append(resp_abuse())
      continue

    # Update the host entry
    with db.cursor() as cur:
      cur.execute('''
          UPDATE `hosts`
          SET `address` = %(address)s,
              `updated` = CURRENT_TIMESTAMP
          WHERE `id` = %(id)s
      ''', {'id': host['id'],
            'address': address})

    logger.info('updater: Host entry updated: %s = %s', hostname, address)

    responses.append(resp_good(value=address))

  return responses


@route('/nic/ip', method='GET')
def get_ip():
  """ Return the IP address of the client extracted from
      the HTTP header.
  """

  return bottle.request.remote_addr


@route('/nic/update', method='GET')

@require(logger='ddserver.utils.logger:Logger')