Standard Headings

The quick brown fox jumps over the lazy dog heading one

The quick brown fox jumps over the lazy dog heading two

The quick brown fox jumps over the lazy dog heading three

The quick brown fox jumps over the lazy dog heading four

The quick brown fox jumps over the lazy dog heading five

Paragraph Text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sem sem, blandit ac ante in, ullamcorper condimentum enim. Ut a felis dui. Nulla pulvinar condimentum metus, eget porttitor ipsum tincidunt vitae. Mauris eget erat at enim interdum semper a nec quam. Quisque viverra augue sit amet sapien laoreet vulputate. Maecenas auctor nisi augue, id pretium ligula finibus nec. Cras aliquam elementum imperdiet. Ut scelerisque odio nec ante accumsan tincidunt.

Etiam ut ullamcorper nibh. Quisque ullamcorper consectetur dui. Phasellus nec risus ex. Nam eget leo commodo, pharetra lacus non, consectetur diam. Praesent sollicitudin ante vel ante posuere, sed dapibus neque pharetra. Maecenas fermentum odio id felis fringilla, id porttitor purus congue. Integer at dapibus risus. Integer consequat augue sed odio dapibus, in congue neque eleifend. Aenean efficitur varius interdum. Sed varius magna libero, eget egestas quam maximus sit amet. Vestibulum lobortis sed tortor nec scelerisque. Nunc sagittis lorem ac orci hendrerit auctor. Duis viverra hendrerit aliquet. Vivamus id placerat arcu, nec cursus tortor.

Lists

List with Context

Code

@singleton
class Registry(object):
    tasks = {}

    def task(self, func, **opts):
        """Decorator to turn a function into a task.
        Also registers the function in the task registry if it
        has not already.
        To use it, wrap your function with this decorator.
        @task
        def function_name_here():
            pass
        """
        if func.__name__ not in self.tasks:
            self.tasks[func.__name__] = dict(func=func, opts=opts, name=func.__name__)
        task_obj = Task(func=func)
        return task_obj

    def async_task(self, func, **opts):
        # TODO: preserve __name__ and others.
        opts.update({'is_async': True})
        if func.__name__ not in self.tasks:
            self.tasks[func.__name__] = dict(func=func, opts=opts)
        task_obj = Task(func=func)
        return task_obj


registry = Registry.instance()
task = registry.task
async_task = registry.async_task