Source

orgtool / orgtool / ext / finances / __init__.py

Full commit
# -*- coding: utf-8 -*-
#
#  Copyright (c) 2009—2010 Andrey Mikhailenko and contributors
#
#  This file is part of OrgTool.
#
#  OrgTool is free software under terms of the GNU Lesser
#  General Public License version 3 (LGPLv3) as published by the Free
#  Software Foundation. See the file README for copying conditions.
#
"""
Finances
========
"""
from tool.plugins import BasePlugin
from tool.ext.templating import register_templates
from schema import *
from views import *
from commands import command_list
import admin


class CLIMoneyTracker(BasePlugin):
    """Money tracker: CLI interface.
    """
    commands = command_list
    features = 'money'

    def make_env(self, default_currency='EUR'):
        return {'default_currency': default_currency}


class WebMoneyTracker(CLIMoneyTracker):
    """Money tracker: web interface.
    """
    requires = ['{templating}', '{routing}']

    def make_env(self, default_currency='EUR'):
        register_templates(__name__)
        return {'default_currency': default_currency}