## $Id: utils.py 12175 2014-12-08 15:24:44Z 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 os import pytz from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes from ikobacustom.skeleton.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 SkeletonIkobaUtils(IkobaUtils): """A collection of methods subject to customization. """ PORTAL_LANGUAGE = 'en' PREFERRED_LANGUAGES_DICT = { 'en':(1, u'English'), 'fr':(2, u'Français'), 'de':(3, u'Deutsch'), 'ha':(4, u'Hausa'), 'yo':(5, u'Yoruba'), 'ig':(6, u'Igbo'), } #: 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')