source: main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/utils/utils.py @ 17367

Last change on this file since 17367 was 14197, checked in by Henrik Bettermann, 8 years ago

Add components for customer JPG documents.

  • Property svn:keywords set to Id
File size: 2.8 KB
RevLine 
[12175]1## $Id: utils.py 14197 2016-09-28 07:04:12Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""Customize general helper utilities for Ikoba.
19"""
20import pytz
21from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes
[14178]22from ikobacustom.uniben.interfaces import MessageFactory as _
[12175]23
24INT_PHONE_PREFIXES = [
25    (1, _('Nigeria'), '234'),
26    (99, _('Germany'), '49'),
27    (99, _('United States'), '1'),
28    (99, _('Niger'), '227'),
29    (99, _('Benin'), '229'),
30    (99, _('Cameroon'), '237'),
31    (99, _('United Kingdom'), '44'),
32    (99, _('France'), '33'),
33    ]
34
[14181]35class UnibenIkobaUtils(IkobaUtils):
[12175]36    """A collection of methods subject to customization.
37    """
38    PORTAL_LANGUAGE = 'en'
39
[12379]40    # CURRENCIES must be equal to or an excerpt of ISO_4217_CURRENCIES
41    CURRENCIES = {
[12381]42        'EUR': ('EUROPE', _('Euro'), 2, '978'),
43        'USD': ('U.S.', _('US Dollar'), 2, '840'),
44        'NGN': ('NIGERIA', _('Naira'), 2, '566'),
45        }
[12379]46
[12389]47    CON_CATS_DICT = {
[14184]48        'riaa': 'Research and Innovative Achievement Award',
[12389]49        'no': 'no contract',
50        }
51
[12175]52    PREFERRED_LANGUAGES_DICT = {
53        'en':(1, u'English'),
54        'fr':(2, u'Français'),
55        'de':(3, u'Deutsch'),
56        'ha':(4, u'Hausa'),
57        'yo':(5, u'Yoruba'),
58        'ig':(6, u'Igbo'),
59        }
60
[12298]61    EXPORTER_NAMES = (
[12284]62        'pdfdocuments',
63        'htmldocuments',
[12411]64        'restdocuments',
[12284]65        'users',
[12298]66        'products',
67        'customers',
[14184]68        'unibencustomerpdfdocuments',
[14197]69        'unibencustomerjpgdocuments',
[14184]70        'riaacontracts')
[12284]71
72    BATCH_PROCESSOR_NAMES = (
[14178]73        'unibencustomerprocessor',
[14184]74        'unibencustomerpdfdocumentprocessor',
[14197]75        'unibencustomerjpgdocumentprocessor',
[14184]76        'riaacontractprocessor',
[14178]77        'unibenproductprocessor',
[12284]78        'pdfdocumentprocessor',
79        'htmldocumentprocessor',
[12411]80        'restdocumentprocessor',
[12284]81        'userprocessor')
82
[12175]83    #: A function to return
84    @classmethod
85    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
86        return sorted_phone_prefixes(data, request)
87
88    @property
89    def tzinfo(self):
90        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.