## $Id: utils.py 14197 2016-09-28 07:04:12Z henrik $
##
## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
## This program 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 2 of the License, or
## (at your option) any later version.
##
## This program 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 this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
"""Customize general helper utilities for Ikoba.
"""
import pytz
from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes
from ikobacustom.uniben.interfaces import MessageFactory as _

INT_PHONE_PREFIXES = [
    (1, _('Nigeria'), '234'),
    (99, _('Germany'), '49'),
    (99, _('United States'), '1'),
    (99, _('Niger'), '227'),
    (99, _('Benin'), '229'),
    (99, _('Cameroon'), '237'),
    (99, _('United Kingdom'), '44'),
    (99, _('France'), '33'),
    ]

class UnibenIkobaUtils(IkobaUtils):
    """A collection of methods subject to customization.
    """
    PORTAL_LANGUAGE = 'en'

    # CURRENCIES must be equal to or an excerpt of ISO_4217_CURRENCIES
    CURRENCIES = {
        'EUR': ('EUROPE', _('Euro'), 2, '978'),
        'USD': ('U.S.', _('US Dollar'), 2, '840'),
        'NGN': ('NIGERIA', _('Naira'), 2, '566'),
        }

    CON_CATS_DICT = {
        'riaa': 'Research and Innovative Achievement Award',
        'no': 'no contract',
        }

    PREFERRED_LANGUAGES_DICT = {
        'en':(1, u'English'),
        'fr':(2, u'Fran&ccedil;ais'),
        'de':(3, u'Deutsch'),
        'ha':(4, u'Hausa'),
        'yo':(5, u'Yoruba'),
        'ig':(6, u'Igbo'),
        }

    EXPORTER_NAMES = (
        'pdfdocuments',
        'htmldocuments',
        'restdocuments',
        'users',
        'products',
        'customers',
        'unibencustomerpdfdocuments',
        'unibencustomerjpgdocuments',
        'riaacontracts')

    BATCH_PROCESSOR_NAMES = (
        'unibencustomerprocessor',
        'unibencustomerpdfdocumentprocessor',
        'unibencustomerjpgdocumentprocessor',
        'riaacontractprocessor',
        'unibenproductprocessor',
        'pdfdocumentprocessor',
        'htmldocumentprocessor',
        'restdocumentprocessor',
        'userprocessor')

    #: A function to return
    @classmethod
    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
        return sorted_phone_prefixes(data, request)

    @property
    def tzinfo(self):
        return pytz.timezone('Africa/Lagos')
