Skip to content

base

BaseMigrator

Source code in cassini/migrate/base.py
 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
class BaseMigrator:
    cell_processors: List[CellProcessor] = []

    def __init_subclass__(cls) -> None:
        cls.cell_processors = []

    @classmethod
    def _cell_processor(cls, f: CellProcessor):
        cls.cell_processors.append(f)
        return f

    def walk_tiers(self):
        """
        Generator for iterating through each tier in a project.
        """
        yield self.home

        for wp in self.home:
            yield wp

            for exp in wp:
                yield exp

                for smpl in exp:
                    yield smpl

    @abstractmethod
    def migrate(self):
        """
        Perform the migration.
        """

walk_tiers

walk_tiers()

Generator for iterating through each tier in a project.

Source code in cassini/migrate/base.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def walk_tiers(self):
    """
    Generator for iterating through each tier in a project.
    """
    yield self.home

    for wp in self.home:
        yield wp

        for exp in wp:
            yield exp

            for smpl in exp:
                yield smpl

migrate abstractmethod

migrate()

Perform the migration.

Source code in cassini/migrate/base.py
35
36
37
38
39
@abstractmethod
def migrate(self):
    """
    Perform the migration.
    """