初始提交,未完全测试

This commit is contained in:
2026-02-27 14:37:10 +08:00
parent 76c0f469be
commit e270f02073
68 changed files with 5886 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
JFinal NumberDirective - Number Directive
"""
from ...Directive import Directive
from ...Env import Env
from ...stat.Scope import Scope
class NumberDirective(Directive):
"""Number directive for number formatting"""
def exec(self, env: Env, scope: Scope, writer) -> None:
"""
Execute number directive
Args:
env: Template environment
scope: Execution scope
writer: Output writer
"""
if self.expr_list:
# Get number value
number_value = self.expr_list.eval(scope)
if number_value is not None:
# Format number
formatted = str(number_value)
if hasattr(writer, 'write'):
writer.write(formatted)
def __repr__(self) -> str:
return "NumberDirective()"