# Path: ddserver/utils/deps.py
# def extend(self, extend):
#   ''' Extends this export.
# 
#       The instance created by the wrapped factory is extended by passing the
#       created instance to the given extend function after creation.
# 
#       The extend function must accept the instance as its only argument. If
#       the function returns a value which is not None, the instance is replaced
#       with the returned value.
#   '''
# 
#   assert self.__instance is None
# 
#   self.__extends.append(extend)
# 
# def export(**requirements):
#   ''' Decorator to export a factory.
# 
#       Requirements for the factory can be specified. These requirements are
#       passed to the wrapped function as specified by the `require` decorator.
#   '''
# 
#   def wrapper(func):
#     return Export(factory = require(**requirements)(func))
# 
#   return wrapper


import sys
import logging
from ddserver.utils.deps import extend, export

ddserver is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ddserver is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ddserver.  If not, see <http://www.gnu.org/licenses/>.
'''





@extend('ddserver.config:ConfigDeclaration')
def config_logging(config_decl):
  with config_decl.declare('logging') as s:
    s('verbose',
      conv = bool,
      default = False)
    s('file',
      conv = str,
      default = '/var/log/ddserver.log')



# Path: ddserver/utils/deps.py
# def extend(self, extend):
#   ''' Extends this export.
# 
#       The instance created by the wrapped factory is extended by passing the
#       created instance to the given extend function after creation.
# 
#       The extend function must accept the instance as its only argument. If
#       the function returns a value which is not None, the instance is replaced
#       with the returned value.
#   '''
# 
#   assert self.__instance is None
# 
#   self.__extends.append(extend)
# 
# def export(**requirements):
#   ''' Decorator to export a factory.
# 
#       Requirements for the factory can be specified. These requirements are
#       passed to the wrapped function as specified by the `require` decorator.
#   '''
# 
#   def wrapper(func):
#     return Export(factory = require(**requirements)(func))
# 
#   return wrapper


# Path: ddserver/utils/logger.py
import sys
import logging
from ddserver.utils.deps import extend, export


ddserver is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ddserver is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ddserver.  If not, see <http://www.gnu.org/licenses/>.
'''





@extend('ddserver.config:ConfigDeclaration')
def config_logging(config_decl):
  with config_decl.declare('logging') as s:
    s('verbose',
      conv = bool,
      default = False)
    s('file',
      conv = str,
      default = '/var/log/ddserver.log')



@export(config = 'ddserver.config:Config')