| Trees | Indices | Help |
|
|---|
|
|
1 #!/usr/bin/env python 2 # -*- coding: UTF8 -*- 3 # 4 # GObjectSingleton.py 5 # Copyright (c) 2006 INdT (Instituto Nokia de Tecnologia) 6 # Author: Eduardo de Barros Lima <eduardo.lima@indt.org.br> 7 # 8 # This program is free software; you can redistribute it and/or 9 # modify it under the terms of the GNU Lesser General Public License as 10 # published by the Free Software Foundation; either version 2.1 of the 11 # License, or (at your option) any later version. 12 # 13 # This program is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU Lesser General Public License for more details. 17 # 18 # You should have received a copy of the GNU Lesser General Public License 19 # along with this program; if not, write to the Free Software 20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 21 # USA 22 23 import gobject 24263728 gobject.GObjectMeta.__init__(cls, name, base, dict) 29 cls.__instance = None 30 cls.__copy__ = lambda self: self 31 cls.__deepcopy__ = lambda self, memo=None: self3234 if not cls.__instance: 35 cls.__instance = super(GObjectSingleton, cls).__call__(*args, **kwargs) 36 return cls.__instance39 """ 40 A model that implements the Singleton pattern. 41 """ 42 43 __metaclass__ = GObjectSingleton 44 45 pass46
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat Aug 2 22:18:40 2008 | http://epydoc.sourceforge.net |