Skip to content

Commit 2a8b423

Browse files
committed
Fix code style & typo
1 parent 3aa3b13 commit 2a8b423

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

fluent.runtime/fluent/runtime/types.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _init_options(self, dt_obj: Union[date, datetime], kwargs: Dict[str, Any]) -
350350
raise TypeError("timeStyle option can only be specified for datetime or time instances, not date instance")
351351

352352
if 'dateStyle' in kwargs and not isinstance(self, (datetime, date)):
353-
raise TypeError("dateStyle option can only be specified for datetime or time instances, not date instance")
353+
raise TypeError("dateStyle option can only be specified for datetime or date instances, not time instance")
354354

355355
self.options = merge_options(
356356
DateFormatOptions, getattr(dt_obj, "options", None), kwargs
@@ -369,9 +369,9 @@ def format(self, locale: Locale) -> str:
369369
ts = self.options.timeStyle
370370
if ds is None:
371371
if ts is None and not isinstance(selftz, time):
372-
return format_date(selftz, format='medium', locale=locale)
372+
return format_date(selftz, format="medium", locale=locale)
373373
else:
374-
return format_time(selftz, format=ts or 'short', locale=locale)
374+
return format_time(selftz, format=ts or "short", locale=locale)
375375
elif ts is None:
376376
return format_date(selftz, format=ds, locale=locale)
377377

@@ -409,9 +409,14 @@ def from_date(cls, dt_obj: date, **kwargs: Any) -> "FluentDate":
409409

410410
class FluentTime(FluentDateType, time):
411411
@classmethod
412-
def from_time(cls, dt_obj: time, **kwargs) -> 'FluentTime':
413-
obj = cls(dt_obj.hour, dt_obj.minute, dt_obj.second,
414-
dt_obj.microsecond, tzinfo=dt_obj.tzinfo)
412+
def from_time(cls, dt_obj: time, **kwargs) -> "FluentTime":
413+
obj = cls(
414+
dt_obj.hour,
415+
dt_obj.minute,
416+
dt_obj.second,
417+
dt_obj.microsecond,
418+
tzinfo=dt_obj.tzinfo
419+
)
415420
obj._init_options(dt_obj, kwargs)
416421
return obj
417422

0 commit comments

Comments
 (0)