diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..0f4ef16 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include README.md +include LICENSE +recursive-include py_enjoy * diff --git a/README.md b/README.md index 2cc464a..d10d661 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # py_enjoy -jfinal-enjoy的 python3.9实现 \ No newline at end of file +jfinal-enjoy的 python3.9+ 实现 + +mrzhou@miw.cn +2026.2.26 diff --git a/README.py b/README.py index 747ace8..3083da9 100644 --- a/README.py +++ b/README.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3.9 # -*- coding: utf-8 -*- """ -JFinal Template Engine Python Implementation +enjoy5.2.2 的 Python 3.9+ 实现 ============================================= This is a Python 3.9+ implementation of the JFinal Template Engine (Enjoy). diff --git a/__init__.py b/py_enjoy/__init__.py similarity index 100% rename from __init__.py rename to py_enjoy/__init__.py diff --git a/kit/Func.py b/py_enjoy/kit/Func.py similarity index 100% rename from kit/Func.py rename to py_enjoy/kit/Func.py diff --git a/kit/HashKit.py b/py_enjoy/kit/HashKit.py similarity index 100% rename from kit/HashKit.py rename to py_enjoy/kit/HashKit.py diff --git a/kit/JavaKeyword.py b/py_enjoy/kit/JavaKeyword.py similarity index 100% rename from kit/JavaKeyword.py rename to py_enjoy/kit/JavaKeyword.py diff --git a/kit/Kv.py b/py_enjoy/kit/Kv.py similarity index 100% rename from kit/Kv.py rename to py_enjoy/kit/Kv.py diff --git a/kit/Okv.py b/py_enjoy/kit/Okv.py similarity index 100% rename from kit/Okv.py rename to py_enjoy/kit/Okv.py diff --git a/kit/Prop.py b/py_enjoy/kit/Prop.py similarity index 100% rename from kit/Prop.py rename to py_enjoy/kit/Prop.py diff --git a/kit/PropKit.py b/py_enjoy/kit/PropKit.py similarity index 100% rename from kit/PropKit.py rename to py_enjoy/kit/PropKit.py diff --git a/kit/ReflectKit.py b/py_enjoy/kit/ReflectKit.py similarity index 100% rename from kit/ReflectKit.py rename to py_enjoy/kit/ReflectKit.py diff --git a/kit/StrKit.py b/py_enjoy/kit/StrKit.py similarity index 100% rename from kit/StrKit.py rename to py_enjoy/kit/StrKit.py diff --git a/kit/SyncWriteMap.py b/py_enjoy/kit/SyncWriteMap.py similarity index 100% rename from kit/SyncWriteMap.py rename to py_enjoy/kit/SyncWriteMap.py diff --git a/kit/TimeKit.py b/py_enjoy/kit/TimeKit.py similarity index 100% rename from kit/TimeKit.py rename to py_enjoy/kit/TimeKit.py diff --git a/kit/TypeKit.py b/py_enjoy/kit/TypeKit.py similarity index 100% rename from kit/TypeKit.py rename to py_enjoy/kit/TypeKit.py diff --git a/proxy/ProxyClass.py b/py_enjoy/proxy/ProxyClass.py similarity index 100% rename from proxy/ProxyClass.py rename to py_enjoy/proxy/ProxyClass.py diff --git a/proxy/ProxyClassLoader.py b/py_enjoy/proxy/ProxyClassLoader.py similarity index 100% rename from proxy/ProxyClassLoader.py rename to py_enjoy/proxy/ProxyClassLoader.py diff --git a/proxy/ProxyCompiler.py b/py_enjoy/proxy/ProxyCompiler.py similarity index 100% rename from proxy/ProxyCompiler.py rename to py_enjoy/proxy/ProxyCompiler.py diff --git a/template/Directive.py b/py_enjoy/template/Directive.py similarity index 100% rename from template/Directive.py rename to py_enjoy/template/Directive.py diff --git a/template/Engine.py b/py_enjoy/template/Engine.py similarity index 100% rename from template/Engine.py rename to py_enjoy/template/Engine.py diff --git a/template/EngineConfig.py b/py_enjoy/template/EngineConfig.py similarity index 100% rename from template/EngineConfig.py rename to py_enjoy/template/EngineConfig.py diff --git a/template/Env.py b/py_enjoy/template/Env.py similarity index 100% rename from template/Env.py rename to py_enjoy/template/Env.py diff --git a/template/Template.py b/py_enjoy/template/Template.py similarity index 100% rename from template/Template.py rename to py_enjoy/template/Template.py diff --git a/template/TemplateException.py b/py_enjoy/template/TemplateException.py similarity index 100% rename from template/TemplateException.py rename to py_enjoy/template/TemplateException.py diff --git a/template/expr/__init__.py b/py_enjoy/template/expr/__init__.py similarity index 100% rename from template/expr/__init__.py rename to py_enjoy/template/expr/__init__.py diff --git a/template/expr/ast/Arith.py b/py_enjoy/template/expr/ast/Arith.py similarity index 100% rename from template/expr/ast/Arith.py rename to py_enjoy/template/expr/ast/Arith.py diff --git a/template/expr/ast/Compare.py b/py_enjoy/template/expr/ast/Compare.py similarity index 100% rename from template/expr/ast/Compare.py rename to py_enjoy/template/expr/ast/Compare.py diff --git a/template/expr/ast/Const.py b/py_enjoy/template/expr/ast/Const.py similarity index 100% rename from template/expr/ast/Const.py rename to py_enjoy/template/expr/ast/Const.py diff --git a/template/expr/ast/Expr.py b/py_enjoy/template/expr/ast/Expr.py similarity index 100% rename from template/expr/ast/Expr.py rename to py_enjoy/template/expr/ast/Expr.py diff --git a/template/expr/ast/FieldKeyBuilder.py b/py_enjoy/template/expr/ast/FieldKeyBuilder.py similarity index 100% rename from template/expr/ast/FieldKeyBuilder.py rename to py_enjoy/template/expr/ast/FieldKeyBuilder.py diff --git a/template/expr/ast/FieldKit.py b/py_enjoy/template/expr/ast/FieldKit.py similarity index 100% rename from template/expr/ast/FieldKit.py rename to py_enjoy/template/expr/ast/FieldKit.py diff --git a/template/expr/ast/MethodKit.py b/py_enjoy/template/expr/ast/MethodKit.py similarity index 100% rename from template/expr/ast/MethodKit.py rename to py_enjoy/template/expr/ast/MethodKit.py diff --git a/template/expr/ast/SharedMethodKit.py b/py_enjoy/template/expr/ast/SharedMethodKit.py similarity index 100% rename from template/expr/ast/SharedMethodKit.py rename to py_enjoy/template/expr/ast/SharedMethodKit.py diff --git a/template/expr/ast/__init__.py b/py_enjoy/template/expr/ast/__init__.py similarity index 100% rename from template/expr/ast/__init__.py rename to py_enjoy/template/expr/ast/__init__.py diff --git a/template/ext/__init__.py b/py_enjoy/template/ext/__init__.py similarity index 100% rename from template/ext/__init__.py rename to py_enjoy/template/ext/__init__.py diff --git a/template/ext/directive/CallDirective.py b/py_enjoy/template/ext/directive/CallDirective.py similarity index 100% rename from template/ext/directive/CallDirective.py rename to py_enjoy/template/ext/directive/CallDirective.py diff --git a/template/ext/directive/DateDirective.py b/py_enjoy/template/ext/directive/DateDirective.py similarity index 100% rename from template/ext/directive/DateDirective.py rename to py_enjoy/template/ext/directive/DateDirective.py diff --git a/template/ext/directive/EscapeDirective.py b/py_enjoy/template/ext/directive/EscapeDirective.py similarity index 100% rename from template/ext/directive/EscapeDirective.py rename to py_enjoy/template/ext/directive/EscapeDirective.py diff --git a/template/ext/directive/NumberDirective.py b/py_enjoy/template/ext/directive/NumberDirective.py similarity index 100% rename from template/ext/directive/NumberDirective.py rename to py_enjoy/template/ext/directive/NumberDirective.py diff --git a/template/ext/directive/RandomDirective.py b/py_enjoy/template/ext/directive/RandomDirective.py similarity index 100% rename from template/ext/directive/RandomDirective.py rename to py_enjoy/template/ext/directive/RandomDirective.py diff --git a/template/ext/directive/RenderDirective.py b/py_enjoy/template/ext/directive/RenderDirective.py similarity index 100% rename from template/ext/directive/RenderDirective.py rename to py_enjoy/template/ext/directive/RenderDirective.py diff --git a/template/ext/directive/StringDirective.py b/py_enjoy/template/ext/directive/StringDirective.py similarity index 100% rename from template/ext/directive/StringDirective.py rename to py_enjoy/template/ext/directive/StringDirective.py diff --git a/template/ext/directive/__init__.py b/py_enjoy/template/ext/directive/__init__.py similarity index 100% rename from template/ext/directive/__init__.py rename to py_enjoy/template/ext/directive/__init__.py diff --git a/template/ext/sharedmethod/SharedMethodLib.py b/py_enjoy/template/ext/sharedmethod/SharedMethodLib.py similarity index 100% rename from template/ext/sharedmethod/SharedMethodLib.py rename to py_enjoy/template/ext/sharedmethod/SharedMethodLib.py diff --git a/template/ext/sharedmethod/__init__.py b/py_enjoy/template/ext/sharedmethod/__init__.py similarity index 100% rename from template/ext/sharedmethod/__init__.py rename to py_enjoy/template/ext/sharedmethod/__init__.py diff --git a/template/io/EncoderFactory.py b/py_enjoy/template/io/EncoderFactory.py similarity index 100% rename from template/io/EncoderFactory.py rename to py_enjoy/template/io/EncoderFactory.py diff --git a/template/io/JdkEncoder.py b/py_enjoy/template/io/JdkEncoder.py similarity index 100% rename from template/io/JdkEncoder.py rename to py_enjoy/template/io/JdkEncoder.py diff --git a/template/io/JdkEncoderFactory.py b/py_enjoy/template/io/JdkEncoderFactory.py similarity index 100% rename from template/io/JdkEncoderFactory.py rename to py_enjoy/template/io/JdkEncoderFactory.py diff --git a/template/io/WriterBuffer.py b/py_enjoy/template/io/WriterBuffer.py similarity index 100% rename from template/io/WriterBuffer.py rename to py_enjoy/template/io/WriterBuffer.py diff --git a/template/io/__init__.py b/py_enjoy/template/io/__init__.py similarity index 100% rename from template/io/__init__.py rename to py_enjoy/template/io/__init__.py diff --git a/template/source/ClassPathSource.py b/py_enjoy/template/source/ClassPathSource.py similarity index 100% rename from template/source/ClassPathSource.py rename to py_enjoy/template/source/ClassPathSource.py diff --git a/template/source/ClassPathSourceFactory.py b/py_enjoy/template/source/ClassPathSourceFactory.py similarity index 100% rename from template/source/ClassPathSourceFactory.py rename to py_enjoy/template/source/ClassPathSourceFactory.py diff --git a/template/source/FileSource.py b/py_enjoy/template/source/FileSource.py similarity index 100% rename from template/source/FileSource.py rename to py_enjoy/template/source/FileSource.py diff --git a/template/source/FileSourceFactory.py b/py_enjoy/template/source/FileSourceFactory.py similarity index 100% rename from template/source/FileSourceFactory.py rename to py_enjoy/template/source/FileSourceFactory.py diff --git a/template/source/ISourceFactory.py b/py_enjoy/template/source/ISourceFactory.py similarity index 100% rename from template/source/ISourceFactory.py rename to py_enjoy/template/source/ISourceFactory.py diff --git a/template/source/StringSource.py b/py_enjoy/template/source/StringSource.py similarity index 100% rename from template/source/StringSource.py rename to py_enjoy/template/source/StringSource.py diff --git a/template/source/__init__.py b/py_enjoy/template/source/__init__.py similarity index 100% rename from template/source/__init__.py rename to py_enjoy/template/source/__init__.py diff --git a/template/stat/Compressor.py b/py_enjoy/template/stat/Compressor.py similarity index 100% rename from template/stat/Compressor.py rename to py_enjoy/template/stat/Compressor.py diff --git a/template/stat/OutputDirectiveFactory.py b/py_enjoy/template/stat/OutputDirectiveFactory.py similarity index 100% rename from template/stat/OutputDirectiveFactory.py rename to py_enjoy/template/stat/OutputDirectiveFactory.py diff --git a/template/stat/Parser.py b/py_enjoy/template/stat/Parser.py similarity index 100% rename from template/stat/Parser.py rename to py_enjoy/template/stat/Parser.py diff --git a/template/stat/Scope.py b/py_enjoy/template/stat/Scope.py similarity index 100% rename from template/stat/Scope.py rename to py_enjoy/template/stat/Scope.py diff --git a/template/stat/ast/Define.py b/py_enjoy/template/stat/ast/Define.py similarity index 100% rename from template/stat/ast/Define.py rename to py_enjoy/template/stat/ast/Define.py diff --git a/template/stat/ast/For.py b/py_enjoy/template/stat/ast/For.py similarity index 100% rename from template/stat/ast/For.py rename to py_enjoy/template/stat/ast/For.py diff --git a/template/stat/ast/Output.py b/py_enjoy/template/stat/ast/Output.py similarity index 100% rename from template/stat/ast/Output.py rename to py_enjoy/template/stat/ast/Output.py diff --git a/template/stat/ast/Stat.py b/py_enjoy/template/stat/ast/Stat.py similarity index 100% rename from template/stat/ast/Stat.py rename to py_enjoy/template/stat/ast/Stat.py diff --git a/template/stat/ast/Text.py b/py_enjoy/template/stat/ast/Text.py similarity index 100% rename from template/stat/ast/Text.py rename to py_enjoy/template/stat/ast/Text.py diff --git a/template/stat/ast/__init__.py b/py_enjoy/template/stat/ast/__init__.py similarity index 100% rename from template/stat/ast/__init__.py rename to py_enjoy/template/stat/ast/__init__.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8fe2f47 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..367fde3 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +from setuptools import setup, find_packages +import os + +# Read the README file for long description +with open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r', encoding='utf-8') as f: + long_description = f.read() + +setup( + name='py_enjoy', + version='5.2.2', + description='Python implementation of JFinal Template Engine', + long_description=long_description, + long_description_content_type='text/markdown', + author='James Zhan 詹波 (original), Python port by mrzhou@miw.cn', + author_email='mrzhou@miw.cn', + url='https://github.com/yourusername/py_enjoy', # 请替换为实际的GitHub仓库URL + license='Apache-2.0', + packages=find_packages(), + include_package_data=True, + python_requires='>=3.6', + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Text Processing :: Markup', + ], + keywords='template engine, jfinal, python', +)