root/galaxy-central/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Tools/RecursiveNull.py @ 3

リビジョン 3, 0.7 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1"""
2Nothing, but in a friendly way.  Good for filling in for objects you want to
3hide.  If $form.f1 is a RecursiveNull object, then
4$form.f1.anything["you"].might("use") will resolve to the empty string.
5
6This module was contributed by Ian Bicking.
7"""
8
9class RecursiveNull(object):
10    def __getattr__(self, attr):
11        return self
12    def __getitem__(self, item):
13        return self
14    def __call__(self, *args, **kwargs):
15        return self
16    def __str__(self):
17        return ''
18    def __repr__(self):
19        return ''
20    def __nonzero__(self):
21        return 0
22    def __eq__(self, x):
23        if x:
24            return False
25        return True
26    def __ne__(self, x):
27        return x and True or False
28
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。