@@ -0,0 +1,2628 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0AScroll modules.%0A%0AConfiguration parameters:%0A    cache_timeout: refresh interval for this module (default 1)%0A    length: specify a length of characters to scroll (default 25)%0A%0AFormat placeholders:%0A    %7Boutput%7D output%0A%0A@author farnoy%0A%0ASAMPLE OUTPUT%0A%5B%0A    %7B'full_text': 'module 4', 'separator': True%7D,%0A    %7B'full_text': 'module 5', 'separator': True%7D,%0A    %7B'full_text': 'module 6', 'separator': True%7D,%0A%5D%0A%22%22%22%0A%0ASTRING_ERROR = %22missing modules%22%0A%0A%0Aclass Py3status:%0A    %22%22%22%0A    %22%22%22%0A%0A    # available configuration parameters%0A    cache_timeout = 1%0A    length = 25%0A%0A    class Meta:%0A        container = True%0A%0A    def post_config_hook(self):%0A        if len(self.items) %3C= 1:%0A            raise Exception(STRING_ERROR)%0A        self.format = %22%7Boutput%7D%22%0A        self.index = 0%0A%0A    def _set_scroll(self):%0A        length = sum(%0A            len(output%5B%22full_text%22%5D)%0A            for item in self.items%0A            for output in self.py3.get_output(item)%0A        )%0A%0A        self.index += 1%0A        if length %3C= self.length:%0A            self.index = 0%0A        self.index = self.index %25 length%0A%0A    def scroll(self):%0A        self._set_scroll()%0A        length_position = 0%0A        last_position = 0%0A%0A        composite = %5B%5D%0A        while length_position %3C self.length:%0A            for item in self.items:%0A                _composite = %5B%5D%0A                for output in self.py3.get_output(item):%0A                    # cut strings%0A                    start = max(0, self.index - last_position)%0A                    end = max(0, self.length - length_position)%0A                    sliced = output%5B%22full_text%22%5D%5Bstart:%5D%5B:end%5D%0A                    # set positions%0A                    length_position += len(sliced)%0A                    last_position += len(output%5B%22full_text%22%5D)%0A                    output%5B%22full_text%22%5D = sliced%0A                    # disable separators%0A                    if output%5B%22full_text%22%5D:%0A                        output%5B%22separator%22%5D = False%0A                        _composite.append(output)%0A                # enable separators%0A                if _composite:%0A                    _composite%5B-1%5D%5B%22separator%22%5D = True%0A                    _composite%5B-1%5D.pop(%22separator_block_width%22, None)%0A                composite += _composite%0A%0A        scroll_data = %7B%22output%22: self.py3.composite_create(composite)%7D%0A%0A        return %7B%0A            %22cached_until%22: self.py3.time_in(self.cache_timeout),%0A            %22full_text%22: self.py3.safe_format(self.format, scroll_data),%0A        %7D%0A%0A%0Aif __name__ == %22__main__%22:%0A    %22%22%22%0A    Run module in test mode.%0A    %22%22%22%0A    from py3status.module_test import module_test%0A%0A    module_test(Py3status)%0A

add new module: scroll (#1748)