Skip to content

Commit d037556

Browse files
authored
Only expose the basic transforms from fluent.migrate (#46)
When writing Fluent migration specs, only the transforms like CONCAT, COPY, PLURALS and REPLACE are really required. All other exports are either helpers or specific to tools/migrate/migrate-l10n.py. Fixes #43.
1 parent e208161 commit d037556

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

fluent/migrate/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# coding=utf8
22

3-
from .context import MergeContext # noqa: F401
4-
from .errors import ( # noqa: F401
5-
MigrationError, NotSupportedError, UnreadableReferenceError
6-
)
73
from .transforms import ( # noqa: F401
8-
Source, COPY, REPLACE_IN_TEXT, REPLACE, PLURALS, CONCAT
9-
)
10-
from .helpers import ( # noqa: F401
11-
EXTERNAL_ARGUMENT, MESSAGE_REFERENCE
4+
CONCAT, COPY, PLURALS, REPLACE, REPLACE_IN_TEXT
125
)
13-
from .changesets import convert_blame_to_changesets # noqa: F401

tools/migrate/examples/about_dialog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# coding=utf8
22

33
import fluent.syntax.ast as FTL
4-
from fluent.migrate import (
5-
CONCAT, EXTERNAL_ARGUMENT, MESSAGE_REFERENCE, COPY, REPLACE
6-
)
4+
from fluent.migrate import CONCAT, COPY, REPLACE
5+
from fluent.migrate.helpers import EXTERNAL_ARGUMENT, MESSAGE_REFERENCE
76

87

98
def migrate(ctx):

tools/migrate/examples/about_downloads.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# coding=utf8
22

33
import fluent.syntax.ast as FTL
4-
from fluent.migrate import EXTERNAL_ARGUMENT, COPY, PLURALS, REPLACE_IN_TEXT
4+
from fluent.migrate import COPY, PLURALS, REPLACE_IN_TEXT
5+
from fluent.migrate.helpers import EXTERNAL_ARGUMENT
56

67

78
def migrate(ctx):

tools/migrate/examples/bug_1291693.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# coding=utf8
22

33
import fluent.syntax.ast as FTL
4-
from fluent.migrate import MESSAGE_REFERENCE, COPY, REPLACE
4+
from fluent.migrate import COPY, REPLACE
5+
from fluent.migrate.helpers import MESSAGE_REFERENCE
56

67

78
def migrate(ctx):

tools/migrate/migrate-l10n.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import hglib
1212
from hglib.util import b
1313

14-
from fluent.migrate import (
15-
MergeContext, MigrationError, convert_blame_to_changesets
16-
)
14+
from fluent.migrate.context import MergeContext
15+
from fluent.migrate.errors import MigrationError
16+
from fluent.migrate.changesets import convert_blame_to_changesets
1717
from blame import Blame
1818

1919

0 commit comments

Comments
 (0)