00001 __copyright__ = """
00002 Copyright 2008 Sean Ross-Ross
00003 """
00004 __license__ = """
00005 This file is part of SLIMpy .
00006
00007 SLIMpy is free software: you can redistribute it and/or modify
00008 it under the terms of the GNU Lesser General Public License as published by
00009 the Free Software Foundation, either version 3 of the License, or
00010 (at your option) any later version.
00011
00012 SLIMpy is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 GNU Lesser General Public License for more details.
00016
00017 You should have received a copy of the GNU Lesser General Public License
00018 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00019 """
00020
00021
00022
00023 def depends_on( *deps ):
00024 def depends_on_decorator( func ):
00025 if not hasattr(func, '__additional_dependancies__'):
00026 setattr(func, '__additional_dependancies__' , list(deps) )
00027 else:
00028 added_deps = getattr(func, '__additional_dependancies__')
00029 added_deps.extend( deps )
00030
00031 return func
00032 return depends_on_decorator
00033
00034 def depends_on_functions( *deps ):
00035 def depends_on_decorator( func ):
00036 if not hasattr(func, '__function_dependancies__'):
00037 setattr(func, '__function_dependancies__' , list(deps) )
00038 else:
00039 added_deps = getattr(func, '__function_dependancies__')
00040 added_deps.extend( deps )
00041
00042 return func
00043 return depends_on_decorator
00044