<commit_before># -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4

##
## Stoqdrivers
## Copyright (C) 2005 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program 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 General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
##
## Author(s):   <NAME>      <<EMAIL>>
##
"""
Sweda IFS9000I driver
"""

import string
import datetime
from decimal import Decimal

from kiwi.log import Logger
from zope.interface import implements

from stoqdrivers.constants import (TAX_SUBSTITUTION,
                                   TAX_EXEMPTION, TAX_NONE,  UNIT_WEIGHT,
                                   UNIT_METERS, UNIT_LITERS, UNIT_EMPTY,
                                   UNIT_CUSTOM)
from stoqdrivers.exceptions import (PrinterError, CloseCouponError,
                                    PendingReadX, CommandError,
                                    CouponOpenError, CommandParametersError,
                                    CouponNotOpenError, ReduceZError,
                                    HardwareFailure, DriverError,
                                    OutofPaperError, PendingReduceZ,
                                    InvalidState, CancelItemError,
                                    AlreadyTotalized)
from stoqdrivers.devices.interfaces import ICouponPrinter
from stoqdrivers.devices.serialbase import SerialBase
from stoqdrivers.constants import MONEY_PM, CHEQUE_PM
from stoqdrivers.devices.printers.capabilities import Capability
from stoqdrivers.devices.printers.base import BaseDriverConstants
from stoqdrivers.translation import stoqdrivers_gettext

_ = lambda msg: stoqdrivers_gettext(msg)

log = Logger('stoqdrivers.sweda')

class IFS9000IConstants(BaseDriverConstants):
    _constants = {
        # Page 4-12, two decimals
        UNIT_WEIGHT:      '!',
        UNIT_METERS:      '@',
        UNIT_LITERS:      ')',
        UNIT_EMPTY:       '^',
        MONEY_PM:         '01',
        CHEQUE_PM:        '01'
        }

    _tax_constants = [
        # Page 4-8
        (TAX_SUBSTITUTION, 'F', None),
        (TAX_EXEMPTION,    'I', None),
        (TAX_NONE,         'N', None),
        ]


class IFS9000I(SerialBase):

    implements(ICouponPrinter)

    model_name = "Sweda IFS 9000 I"<commit_msg>Add a note to custom tax codes<commit_after># -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4

##
## Stoqdrivers
## Copyright (C) 2005 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program 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 General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
##
## Author(s):   <NAME>      <<EMAIL>>
##
"""
Sweda IFS9000I driver
"""

import string
import datetime
from decimal import Decimal

from kiwi.log import Logger
from zope.interface import implements

from stoqdrivers.constants import (TAX_SUBSTITUTION,
                                   TAX_EXEMPTION, TAX_NONE,  UNIT_WEIGHT,
                                   UNIT_METERS, UNIT_LITERS, UNIT_EMPTY,
                                   UNIT_CUSTOM)
from stoqdrivers.exceptions import (PrinterError, CloseCouponError,
                                    PendingReadX, CommandError,
                                    CouponOpenError, CommandParametersError,
                                    CouponNotOpenError, ReduceZError,
                                    HardwareFailure, DriverError,
                                    OutofPaperError, PendingReduceZ,
                                    InvalidState, CancelItemError,
                                    AlreadyTotalized)
from stoqdrivers.devices.interfaces import ICouponPrinter
from stoqdrivers.devices.serialbase import SerialBase
from stoqdrivers.constants import MONEY_PM, CHEQUE_PM
from stoqdrivers.devices.printers.capabilities import Capability
from stoqdrivers.devices.printers.base import BaseDriverConstants
from stoqdrivers.translation import stoqdrivers_gettext

_ = lambda msg: stoqdrivers_gettext(msg)

log = Logger('stoqdrivers.sweda')

class IFS9000IConstants(BaseDriverConstants):
    _constants = {
        # Page 4-12, two decimals
        UNIT_WEIGHT:      '!',
        UNIT_METERS:      '@',
        UNIT_LITERS:      ')',
        UNIT_EMPTY:       '^',
        MONEY_PM:         '01',
        CHEQUE_PM:        '01'
        }

    _tax_constants = [
        # Page 4-8
        (TAX_SUBSTITUTION, 'F', None),
        (TAX_EXEMPTION,    'I', None),
        (TAX_NONE,         'N', None),
        # Custom, see Page 4-78
        ]


class IFS9000I(SerialBase):

    implements(ICouponPrinter)

    model_name = "Sweda IFS 9000 I"
{'fraction_non_alphanumeric': 0.08144101075635991, 'fraction_numerical': 0.018268738261908828, 'mean_word_length': 2.3189801699716712, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7651556', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1644, 'n_words': 501}