Package ajango :: Package site :: Package presentations
[hide private]
[frames] | no frames]

Source Code for Package ajango.site.presentations

 1  ########################################################################### 
 2  #                                                                         # 
 3  #  Copyright (C) 2016  Rafal Kobel <rafyco1@gmail.com>                    # 
 4  #                                                                         # 
 5  #  This program is free software: you can redistribute it and/or modify   # 
 6  #  it under the terms of the GNU General Public License as published by   # 
 7  #  the Free Software Foundation, either version 3 of the License, or      # 
 8  #  (at your option) any later version.                                    # 
 9  #                                                                         # 
10  #  This program is distributed in the hope that it will be useful,        # 
11  #  but WITHOUT ANY WARRANTY; without even the implied warranty of         # 
12  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the           # 
13  #  GNU General Public License for more details.                           # 
14  #                                                                         # 
15  #  You should have received a copy of the GNU General Public License      # 
16  #  along with this program.  If not, see <http://www.gnu.org/licenses/>.  # 
17  #                                                                         # 
18  ########################################################################### 
19  """ 
20  Modul zarzadzajacy obiektami wyswietlajacymi. 
21   
22  Pozwala na edytowanie danych wedlug okreslonych warunkow przed wyswietleniem 
23  na ekranie. 
24   
25  Dostepne parametry 
26  ================== 
27   
28      - I{type} - Typ widoku do stworzenia 
29   
30  Dostepne obiekty 
31  ================ 
32   
33      - L{powiekszanie liter <ajango.site.presentations.upper>} 
34  """ 
35   
36  from django.core.management.base import CommandError 
37  from ajango.core.factory         import FactoryBase 
38  from ajango.generator.renderer   import DefRenderer 
39  from abc                         import ABCMeta, abstractmethod 
40 41 -class PresentationFactoryObject(FactoryBase):
42 """ Obiekt fabryki wyswietlajacej. """
43 - def init(self):
44 """ Metoda inicjalizujaca. """ 45 self.set_items('Presentation', { 46 'upper' : 'ajango.site.presentations.upper', 47 })
48 - def execution(self, fun):
49 """ Wykonanie zadan fabryki. """ 50 return fun()
51
52 -def presentation_factory(key):
53 """ Fabryka obiektow wyswietlajacych. """ 54 return PresentationFactoryObject().get_class_factory(key)
55
56 -class PresentationBase(object):
57 """ Abstrakcyjna klasa obiektu wyswietlajacego. """ 58 __metaclass__ = ABCMeta
59 - def __init__(self):
60 self.init()
61 - def init(self):
62 """ Inicjalizacja obiektu. """ 63 pass
64 @abstractmethod
65 - def get(self, text):
66 """ Przetworzenie napisu. """ 67 return text
68