This file is indexed.

/usr/share/pyshared/weboob/capabilities/bill.py is in python-weboob-core 0.g-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# -*- coding: utf-8 -*-

# Copyright(C) 2012 Romain Bignon, Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.


from .base import CapBaseObject, StringField, DateField, DecimalField, IntField, UserError, Currency
from .collection import ICapCollection


__all__ = ['SubscriptionNotFound', 'BillNotFound', 'Detail', 'Bill', 'Subscription', 'ICapBill']


class SubscriptionNotFound(UserError):
    """
    Raised when a subscription is not found.
    """
    def __init__(self, msg='Subscription not found'):
        UserError.__init__(self, msg)


class BillNotFound(UserError):
    """
    Raised when a bill is not found.
    """
    def __init__(self, msg='Bill not found'):
        UserError.__init__(self, msg)


class Detail(CapBaseObject):
    """
    Detail of a subscription
    """
    label =     StringField('label of the detail line')
    infos =     StringField('information')
    datetime =  DateField('date information')
    price =     DecimalField('Total price, taxes included')
    vat =       DecimalField('Value added Tax')
    currency =  IntField('Currency', default=Currency.CUR_UNKNOWN)
    quantity =  DecimalField('Number of units consumed')
    unit =      StringField('Unit of the consumption')

    def __init__(self):
        CapBaseObject.__init__(self, 0)


class Bill(CapBaseObject):
    """
    Bill.
    """
    date =          DateField('The day the bill has been sent to the subscriber')
    format =        StringField('file format of the bill')
    label =         StringField('label of bill')
    idparent =      StringField('id of the parent subscription')
    price =         DecimalField('Price to pay')
    currency =      IntField('Currency', default=Currency.CUR_UNKNOWN)
    deadline =      DateField('The latest day to pay')
    startdate =     DateField('The first day the bill applies to')
    finishdate =    DateField('The last day the bill applies to')

    def __init__(self):
        CapBaseObject.__init__(self, 0)


class Subscription(CapBaseObject):
    """
    Subscription to a service.
    """
    label =         StringField('label of subscription')
    subscriber =    StringField('whe has subscribed')
    validity =      DateField('End validity date of the subscription')
    renewdate =     DateField('Reset date of consumption')


class ICapBill(ICapCollection):
    def iter_resources(self, objs, split_path):
        """
        Iter resources. Will return :func:`iter_subscriptions`.
        """
        if Subscription in objs:
            self._restrict_level(split_path)
            return self.iter_subscription()

    def iter_subscription(self):
        """
        Iter subscriptions.

        :rtype: iter[:class:`Subscription`]
        """
        raise NotImplementedError()

    def get_subscription(self, _id):
        """
        Get a subscription.

        :param _id: ID of subscription
        :rtype: :class:`Subscription`
        :raises: :class:`SubscriptionNotFound`
        """
        raise NotImplementedError()

    def iter_bills_history(self, subscription):
        """
        Iter history of a subscription.

        :param subscription: subscription to get history
        :type subscription: :class:`Subscription`
        :rtype: iter[:class:`Detail`]
        """
        raise NotImplementedError()

    def get_bill(self, id):
        """
        Get a bill.

        :param id: ID of bill
        :rtype: :class:`Bill`
        :raises: :class:`BillNotFound`
        """
        raise NotImplementedError()

    def download_bill(self, id):
        """
        Download a bill.

        :param id: ID of bill
        :rtype: str
        :raises: :class:`BillNotFound`
        """
        raise NotImplementedError()

    def iter_bills(self, subscription):
        """
        Iter bills.

        :param subscription: subscription to get bills
        :type subscription: :class:`Subscription`
        :rtype: iter[:class:`Bill`]
        """
        raise NotImplementedError()

    def get_details(self, subscription):
        """
        Get details of a subscription.

        :param subscription: subscription to get details
        :type subscription: :class:`Subscription`
        :rtype: iter[:class:`Detail`]
        """
        raise NotImplementedError()

    def get_balance(self, subscription):
        """
        Get the balance of a subscription.

        :param subscription: subscription to get balance
        :type subscription: :class:`Subscription`
        :rtype :class:`Detail`
        """
        raise NotImplementedError()