Changeset 874cbc4 in rattail


Ignore:
Timestamp:
02/18/19 21:27:57 (6 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
4da37f6
Parents:
3336da3
Message:

Clean up Rattail <-> Rattail import/export handlers a bit

Location:
rattail
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • rattail/importing/rattail.py

    r3336da3 r874cbc4  
    1 # -*- coding: utf-8 -*-
     1# -*- coding: utf-8; -*-
    22################################################################################
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2017 Lance Edgar
     5#  Copyright © 2010-2019 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    128128class FromRattailToRattailImport(FromRattailToRattailBase, FromRattailHandler, ToRattailHandler):
    129129    """
    130     Handler for Rattail -> Rattail data import.
    131     """
    132     local_title = "Rattail (local)"
     130    Handler for Rattail (other) -> Rattail (local) data import.
     131    """
    133132    dbkey = 'host'
    134133
    135134    @property
    136135    def host_title(self):
    137         return "Rattail ({})".format(self.dbkey)
     136        return "{} ({})".format(self.config.app_title(default="Rattail"), self.dbkey)
     137
     138    @property
     139    def local_title(self):
     140        return self.config.node_title()
    138141
    139142    def make_host_session(self):
    140143        return Session(bind=self.config.rattail_engines[self.dbkey])
    141144
    142 # TODO: deprecate/remove this?
    143 FromRattailToRattail = FromRattailToRattailImport
    144 
    145145
    146146class FromRattailToRattailExport(FromRattailToRattailBase, FromRattailHandler, ToRattailHandler):
    147147    """
    148     Handler for Rattail -> Rattail data import.
    149     """
    150     host_title = "Rattail (default)"
     148    Handler for Rattail (local) -> Rattail (other) data export.
     149    """
     150
     151    @property
     152    def host_title(self):
     153        return self.config.node_title()
    151154
    152155    @property
    153156    def local_title(self):
    154         return "Rattail ({})".format(self.dbkey)
     157        return "{} ({})".format(self.config.app_title(default="Rattail"), self.dbkey)
    155158
    156159    def make_session(self):
  • rattail/importing/rattail_bulk.py

    r3336da3 r874cbc4  
    1 # -*- coding: utf-8 -*-
     1# -*- coding: utf-8; -*-
    22################################################################################
    33#
    44#  Rattail -- Retail Software Framework
    5 #  Copyright © 2010-2017 Lance Edgar
     5#  Copyright © 2010-2019 Lance Edgar
    66#
    77#  This file is part of Rattail.
     
    2929from rattail import importing
    3030from rattail.util import OrderedDict
    31 from rattail.importing.rattail import FromRattailToRattail, FromRattail
    32 
    33 
    34 class BulkFromRattailToRattail(FromRattailToRattail, importing.BulkImportHandler):
     31from rattail.importing.rattail import FromRattailToRattailImport, FromRattail
     32
     33
     34class BulkFromRattailToRattail(FromRattailToRattailImport, importing.BulkImportHandler):
    3535    """
    3636    Handler for Rattail -> Rattail bulk data import.
  • rattail/tests/importing/test_rattail.py

    r3336da3 r874cbc4  
    5757
    5858class TestFromRattailToRattail(DualRattailTestCase, ImporterTester):
    59     handler_class = rattail_importing.FromRattailToRattail
     59    handler_class = rattail_importing.FromRattailToRattailImport
    6060
    6161    def test_host_title(self):
Note: See TracChangeset for help on using the changeset viewer.