summaryrefslogtreecommitdiffstats
path: root/format_manager.py
blob: a78ebea3c1baea10c40ecb58c39da2b74834a64b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: UTF-8 -*-
# Copyright 2012 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2 (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
"""Format manager"""
__author__ = "Jan Pokorný <jpokorny at redhat dot com>"

from .format import formats


class FormatManager(object):
    """Class responsible for available formats of data to be converted"""
    def __init__(self, registry=formats, paths=(), formats={}):
        self._registry = registry
        self._formats = dict(registry.discover(paths), **formats)

    @property
    def registry(self):
        return self._registry

    @property
    def formats(self):
        return self._formats.copy()