Example #1
0
    def director(self):
        """Return activitystream director"""
        if asbool(config.get("activitystream.recording.enabled", False)):
            return activitystream.director()
        else:

            class NullActivityStreamDirector(object):
                def connect(self, *a, **kw):
                    pass

                def disconnect(self, *a, **kw):
                    pass

                def is_connected(self, *a, **kw):
                    return False

                def create_activity(self, *a, **kw):
                    pass

                def create_timeline(self, *a, **kw):
                    pass

                def create_timelines(self, *a, **kw):
                    pass

                def get_timeline(self, *a, **kw):
                    return []

            return NullActivityStreamDirector()
Example #2
0
    def director(self):
        """Return activitystream director"""
        if asbool(config.get('activitystream.recording.enabled', False)):
            return activitystream.director()
        else:

            class NullActivityStreamDirector(object):
                def connect(self, *a, **kw):
                    pass

                def disconnect(self, *a, **kw):
                    pass

                def is_connected(self, *a, **kw):
                    return False

                def create_activity(self, *a, **kw):
                    pass

                def create_timeline(self, *a, **kw):
                    pass

                def create_timelines(self, *a, **kw):
                    pass

                def get_timeline(self, *a, **kw):
                    return []

            return NullActivityStreamDirector()
Example #3
0
 def director(self):
     """Return activitystream director"""
     return activitystream.director()