view test/mocknull.py @ 3913:00896a2acaa5

clean up query display of "Private to you" items Previously the handling of queries in the edit menu was a little wonky. If you change a query to not be private to you then you lose the ability to ever change it back to being private. Previously the queries were displayed in three chunks: First all retired queries. Then all queries private to the current user (this batch has the dropdown for toggling private state). Then all non-private queries. Now: all queries we created that are retired, all queries that we created that are not retired, then all non-private queries not created by the current user. this should fix [SF#1481394]
author Justus Pendleton <jpend@users.sourceforge.net>
date Thu, 20 Sep 2007 23:44:58 +0000
parents 79fd8537ae3b
children 3757449e00c4
line wrap: on
line source


class MockNull:
    def __init__(self, **kwargs):
        for key, value in kwargs.items():
            self.__dict__[key] = value

    def __call__(self, *args, **kwargs): return MockNull()
    def __getattr__(self, name):
        # This allows assignments which assume all intermediate steps are Null
        # objects if they don't exist yet.
        #
        # For example (with just 'client' defined):
        #
        # client.db.config.TRACKER_WEB = 'BASE/'
        self.__dict__[name] = MockNull()
        return getattr(self, name)

    def __getitem__(self, key): return self
    def __nonzero__(self): return 0
    def __str__(self): return ''
    def __repr__(self): return '<MockNull 0x%x>'%id(self)
    def gettext(self, str): return str
    _ = gettext

Roundup Issue Tracker: http://roundup-tracker.org/