diff --git a/api.py b/api.py index 9e9ee71..844a530 100644 --- a/api.py +++ b/api.py @@ -1,23 +1,15 @@ # This file is part of the carrier_send_shipments_seurvalencia module for Tryton. # The COPYRIGHT file at the top level of this repository contains the full # copyright notices and license terms. +import logging from trytond.pool import PoolMeta from trytond.pyson import Eval, Not, Equal -import logging - -try: - from seurvalencia.picking import * -except ImportError: - logger = logging.getLogger(__name__) - message = 'Install Seur: pip install seurvalencia' - logger.error(message) - raise Exception(message) +from seurvalencia.picking import * __all__ = ['CarrierApi'] -class CarrierApi: - __metaclass__ = PoolMeta +class CarrierApi(metaclass=PoolMeta): __name__ = 'carrier.api' @classmethod diff --git a/manifest.py b/manifest.py index 6b351df..f953354 100644 --- a/manifest.py +++ b/manifest.py @@ -9,8 +9,7 @@ from base64 import decodestring __all__ = ['CarrierManifest'] -class CarrierManifest: - __metaclass__ = PoolMeta +class CarrierManifest(metaclass=PoolMeta): __name__ = 'carrier.manifest' def get_manifest_seurvalencia(self, api, from_date, to_date): diff --git a/setup.py b/setup.py index 12f4e3f..4306730 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,7 @@ from setuptools import setup import re import os import io -try: - from configparser import ConfigParser -except ImportError: - from ConfigParser import ConfigParser +from configparser import ConfigParser MODULE2PREFIX = {} diff --git a/shipment.py b/shipment.py index 8e639f8..e8f878f 100644 --- a/shipment.py +++ b/shipment.py @@ -13,8 +13,7 @@ __all__ = ['ShipmentOut'] logger = logging.getLogger(__name__) -class ShipmentOut: - __metaclass__ = PoolMeta +class ShipmentOut(metaclass=PoolMeta): __name__ = 'stock.shipment.out' @classmethod