Skip to content

Commit 6dabf2f

Browse files
committed
remove unused code, flake8
1 parent 58c2650 commit 6dabf2f

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

fluent.runtime/fluent/runtime/resolver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
from fluent.syntax import ast as FTL
1111
from .errors import FluentCyclicReferenceError, FluentFormatError, FluentReferenceError
12-
from .types import FluentType, FluentDateType, FluentNone, FluentNumber, FluentInt, FluentFloat, fluent_date, fluent_number
13-
from .utils import numeric_to_native, reference_to_id, unknown_reference_error_obj
12+
from .types import FluentType, FluentNone, FluentInt, FluentFloat
13+
from .utils import reference_to_id, unknown_reference_error_obj
1414

1515

1616
text_type = six.text_type
@@ -111,6 +111,7 @@ def __call__(self, env):
111111
self.dirty = False
112112
return retval
113113

114+
114115
def resolve(fluentish, env):
115116
if isinstance(fluentish, FluentType):
116117
return fluentish.format(env.context._babel_locale)
@@ -148,6 +149,7 @@ def __init__(self, value, **kwargs):
148149
self.value = FluentFloat(self.value)
149150
else:
150151
self.value = FluentInt(self.value)
152+
151153
def __call__(self, env):
152154
return self.value
153155

fluent.runtime/fluent/runtime/utils.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ def add_message_and_attrs_to_store(store, ref_id, item, is_parent=True):
3131
is_parent=False)
3232

3333

34-
def numeric_to_native(val):
35-
"""
36-
Given a numeric string (as defined by fluent spec),
37-
return an int or float
38-
"""
39-
# val matches this EBNF:
40-
# '-'? [0-9]+ ('.' [0-9]+)?
41-
if '.' in val:
42-
return float(val)
43-
return int(val)
44-
45-
4634
def native_to_fluent(val):
4735
"""
4836
Convert a python type to a Fluent Type.
@@ -60,6 +48,7 @@ def native_to_fluent(val):
6048
return FluentDate.from_date(val)
6149
return val
6250

51+
6352
def reference_to_id(ref):
6453
"""
6554
Returns a string reference for a MessageReference, TermReference or AttributeExpression

0 commit comments

Comments
 (0)