rapidframework-lib 1.0.7.2__tar.gz → 1.0.8.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {rapidframework_lib-1.0.7.2/rapidframework_lib.egg-info → rapidframework_lib-1.0.8.1}/PKG-INFO +2 -2
  2. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/README.md +1 -1
  3. rapidframework_lib-1.0.8.1/rapidframework/__init__.py +5 -0
  4. rapidframework_lib-1.0.8.1/rapidframework/frameworks/__init__.py +16 -0
  5. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/bottle.py +1 -1
  6. rapidframework_lib-1.0.7.2/rapidframework/frameworks/cherryPy.py → rapidframework_lib-1.0.8.1/rapidframework/frameworks/cherrypy.py +2 -2
  7. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/django.py +1 -1
  8. rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/pyramid_1.py +14 -0
  9. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/fastapi.py +1 -1
  10. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/flask.py +1 -1
  11. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/grok.py +1 -1
  12. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/pyramid.py +1 -1
  13. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/socketify.py +1 -1
  14. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/turbogears2.py +2 -2
  15. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/web2py.py +1 -1
  16. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/main.py +21 -15
  17. {rapidframework_lib-1.0.7.2/rapidframework/frameworks → rapidframework_lib-1.0.8.1/rapidframework}/template.py +3 -4
  18. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1/rapidframework_lib.egg-info}/PKG-INFO +2 -2
  19. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework_lib.egg-info/SOURCES.txt +14 -14
  20. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/setup.py +1 -1
  21. rapidframework_lib-1.0.7.2/rapidframework/__init__.py +0 -8
  22. rapidframework_lib-1.0.7.2/rapidframework/frameworks/__init__.py +0 -6
  23. rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/pyramid_example_1.py +0 -0
  24. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/LICENSE +0 -0
  25. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/pyproject.toml +0 -0
  26. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/__pycache__/main.cpython-313.pyc +0 -0
  27. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/config.py +0 -0
  28. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/configs/managers.json +0 -0
  29. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/examples/__init__.py +0 -0
  30. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/bottle_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/bottle_1.py +0 -0
  31. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/cherrypy_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/cherrypy_1.py +0 -0
  32. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/fastapi_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/fastapi_1.py +0 -0
  33. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/flask_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/flask_1.py +0 -0
  34. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/grok_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/grok_1.py +0 -0
  35. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/litestar_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/litestar_1.py +0 -0
  36. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/socketify_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/socketify_1.py +0 -0
  37. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/starlette_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/starlette_1.py +0 -0
  38. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/tornado_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/tornado_1.py +0 -0
  39. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/turbogears2_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/turbogears2_1.py +0 -0
  40. /rapidframework_lib-1.0.7.2/rapidframework/frameworks/examples/web2py_example_1.py → /rapidframework_lib-1.0.8.1/rapidframework/frameworks/examples/web2py_1.py +0 -0
  41. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/litestar.py +0 -0
  42. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/starlette.py +0 -0
  43. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework/frameworks/tornado.py +0 -0
  44. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework_lib.egg-info/dependency_links.txt +0 -0
  45. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework_lib.egg-info/entry_points.txt +0 -0
  46. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework_lib.egg-info/requires.txt +0 -0
  47. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/rapidframework_lib.egg-info/top_level.txt +0 -0
  48. {rapidframework_lib-1.0.7.2 → rapidframework_lib-1.0.8.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rapidframework-lib
3
- Version: 1.0.7.2
3
+ Version: 1.0.8.1
4
4
  Description-Content-Type: text/markdown
5
5
  License-File: LICENSE
6
6
  Requires-Dist: msgspec
@@ -13,7 +13,7 @@ Dynamic: requires-dist
13
13
 
14
14
  > **RapidFramework** is a Python library for quickly creating and setting up projects from templates.
15
15
 
16
- ## https://pypi.org/project/rapidframework-lib/1.0.7.2/
16
+ ## https://pypi.org/project/rapidframework-lib/1.0.8.2/
17
17
 
18
18
  ## Installation
19
19
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **RapidFramework** is a Python library for quickly creating and setting up projects from templates.
4
4
 
5
- ## https://pypi.org/project/rapidframework-lib/1.0.7.2/
5
+ ## https://pypi.org/project/rapidframework-lib/1.0.8.2/
6
6
 
7
7
  ## Installation
8
8
 
@@ -0,0 +1,5 @@
1
+ from .config import Config as Config
2
+ from .config import AutoManager as AutoManager
3
+ from .frameworks import Template as Template
4
+
5
+ __version__ = '0.0.1'
@@ -0,0 +1,16 @@
1
+ from ..template import Template as Template
2
+ from .examples import *
3
+
4
+ import os
5
+ import importlib
6
+
7
+ def import_all_modules_from_package():
8
+ current_dir = os.path.dirname(__file__)
9
+ package_name = __name__
10
+
11
+ for filename in os.listdir(current_dir):
12
+ if filename.endswith(".py") and filename != "__init__.py":
13
+ module_name = filename[:-3]
14
+ importlib.import_module(f"{package_name}.{module_name}")
15
+
16
+ import_all_modules_from_package()
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class BottleManager(Template):
@@ -1,7 +1,7 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
- class Cherrypymanager(Template):
4
+ class CherryPyManager(Template):
5
5
  def __init__(self, **kwargs):
6
6
  super().__init__(**kwargs)
7
7
 
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
  from subprocess import run
3
3
  from os import chdir
4
4
 
@@ -0,0 +1,14 @@
1
+ from wsgiref.simple_server import make_server
2
+ from pyramid.config import Configurator
3
+ from pyramid.response import Response
4
+
5
+ def hello_world(request):
6
+ return Response('Hello World!')
7
+
8
+ if __name__ == '__main__':
9
+ with Configurator() as config:
10
+ config.add_route('hello', '/')
11
+ config.add_view(hello_world, route_name='hello')
12
+ app = config.make_wsgi_app()
13
+ server = make_server('0.0.0.0', 6543, app)
14
+ server.serve_forever()
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class FastapiManager(Template):
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class FlaskManager(Template):
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class GrokManager(Template):
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class PyramidManager(Template):
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class SocketifyManager(Template):
@@ -1,7 +1,7 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
- class Turbogears2Manager(Template):
4
+ class TurboGears2Manager(Template):
5
5
  def __init__(self, **kwargs):
6
6
  super().__init__(**kwargs)
7
7
 
@@ -1,4 +1,4 @@
1
- from .template import Template
1
+ from ..template import Template
2
2
 
3
3
 
4
4
  class Web2pyManager(Template):
@@ -1,8 +1,25 @@
1
1
  import argparse
2
- import importlib
3
- import os
4
2
  from pathlib import Path
3
+ from . import Template
5
4
  #
5
+ import gc
6
+
7
+ def all_subclasses(cls):
8
+ subclasses = cls.__subclasses__()
9
+ for subclass in subclasses:
10
+ subclasses += all_subclasses(subclass)
11
+ return subclasses
12
+
13
+ def find_manager_class(base_name: str):
14
+ base_name_lower = base_name.lower()
15
+ target_suffix = "manager"
16
+
17
+ for obj in gc.get_objects():
18
+ if isinstance(obj, type):
19
+ cls_name = obj.__name__
20
+ if cls_name.lower() == base_name_lower + target_suffix:
21
+ return obj
22
+ return None
6
23
 
7
24
  FRAMEWORKS_PATH = Path(__file__).parent / "frameworks"
8
25
 
@@ -29,21 +46,10 @@ class Main:
29
46
  self.framework_manager = self._load_framework_manager()
30
47
 
31
48
  def _discover_frameworks(self):
32
- frameworks = []
33
- for file in os.listdir(FRAMEWORKS_PATH):
34
- if file.endswith(".py") and file != "__init__.py":
35
- framework_name = file.removesuffix('.py').lower()
36
- frameworks.append(framework_name)
37
- return frameworks
49
+ return sorted(set([cls.__name__.removesuffix("Manager").lower() for cls in all_subclasses(Template)]))
38
50
 
39
51
  def _load_framework_manager(self):
40
- module_name = f"rapidframework.frameworks.{self.args.framework}"
41
- class_name = f"{self.args.framework.capitalize()}Manager"
42
-
43
- module = importlib.import_module(module_name)
44
- manager_class = getattr(module, class_name)
45
-
46
- return manager_class(name=self.args.name)
52
+ return find_manager_class(self.args.framework)(name=self.args.name)
47
53
 
48
54
  def run(self):
49
55
  example_id = 1 if self.args.example is None else self.args.example
@@ -1,6 +1,6 @@
1
1
  from os import path
2
- from ..config import AutoManager
3
- from ..config import Config
2
+ from .config import AutoManager
3
+ from .config import Config
4
4
 
5
5
 
6
6
  cfg = Config()
@@ -42,12 +42,11 @@ class Template:
42
42
  cfg.create_files(extra_files)
43
43
 
44
44
  def create_example(self, name, example_id):
45
- print(self.framework_name)
46
45
  from pkgutil import get_data
47
46
 
48
47
  example_code = get_data(
49
48
  "rapidframework",
50
- f"frameworks/examples/{self.framework_name}_example_{example_id}.py",
49
+ f"frameworks/examples/{self.framework_name}_{example_id}.py",
51
50
  ).decode("utf-8")
52
51
 
53
52
  with open(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rapidframework-lib
3
- Version: 1.0.7.2
3
+ Version: 1.0.8.1
4
4
  Description-Content-Type: text/markdown
5
5
  License-File: LICENSE
6
6
  Requires-Dist: msgspec
@@ -13,7 +13,7 @@ Dynamic: requires-dist
13
13
 
14
14
  > **RapidFramework** is a Python library for quickly creating and setting up projects from templates.
15
15
 
16
- ## https://pypi.org/project/rapidframework-lib/1.0.7.2/
16
+ ## https://pypi.org/project/rapidframework-lib/1.0.8.2/
17
17
 
18
18
  ## Installation
19
19
 
@@ -5,11 +5,12 @@ setup.py
5
5
  rapidframework/__init__.py
6
6
  rapidframework/config.py
7
7
  rapidframework/main.py
8
+ rapidframework/template.py
8
9
  rapidframework/__pycache__/main.cpython-313.pyc
9
10
  rapidframework/configs/managers.json
10
11
  rapidframework/frameworks/__init__.py
11
12
  rapidframework/frameworks/bottle.py
12
- rapidframework/frameworks/cherryPy.py
13
+ rapidframework/frameworks/cherrypy.py
13
14
  rapidframework/frameworks/django.py
14
15
  rapidframework/frameworks/fastapi.py
15
16
  rapidframework/frameworks/flask.py
@@ -18,23 +19,22 @@ rapidframework/frameworks/litestar.py
18
19
  rapidframework/frameworks/pyramid.py
19
20
  rapidframework/frameworks/socketify.py
20
21
  rapidframework/frameworks/starlette.py
21
- rapidframework/frameworks/template.py
22
22
  rapidframework/frameworks/tornado.py
23
23
  rapidframework/frameworks/turbogears2.py
24
24
  rapidframework/frameworks/web2py.py
25
25
  rapidframework/frameworks/examples/__init__.py
26
- rapidframework/frameworks/examples/bottle_example_1.py
27
- rapidframework/frameworks/examples/cherrypy_example_1.py
28
- rapidframework/frameworks/examples/fastapi_example_1.py
29
- rapidframework/frameworks/examples/flask_example_1.py
30
- rapidframework/frameworks/examples/grok_example_1.py
31
- rapidframework/frameworks/examples/litestar_example_1.py
32
- rapidframework/frameworks/examples/pyramid_example_1.py
33
- rapidframework/frameworks/examples/socketify_example_1.py
34
- rapidframework/frameworks/examples/starlette_example_1.py
35
- rapidframework/frameworks/examples/tornado_example_1.py
36
- rapidframework/frameworks/examples/turbogears2_example_1.py
37
- rapidframework/frameworks/examples/web2py_example_1.py
26
+ rapidframework/frameworks/examples/bottle_1.py
27
+ rapidframework/frameworks/examples/cherrypy_1.py
28
+ rapidframework/frameworks/examples/fastapi_1.py
29
+ rapidframework/frameworks/examples/flask_1.py
30
+ rapidframework/frameworks/examples/grok_1.py
31
+ rapidframework/frameworks/examples/litestar_1.py
32
+ rapidframework/frameworks/examples/pyramid_1.py
33
+ rapidframework/frameworks/examples/socketify_1.py
34
+ rapidframework/frameworks/examples/starlette_1.py
35
+ rapidframework/frameworks/examples/tornado_1.py
36
+ rapidframework/frameworks/examples/turbogears2_1.py
37
+ rapidframework/frameworks/examples/web2py_1.py
38
38
  rapidframework_lib.egg-info/PKG-INFO
39
39
  rapidframework_lib.egg-info/SOURCES.txt
40
40
  rapidframework_lib.egg-info/dependency_links.txt
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="rapidframework-lib",
6
- version="1.0.7.2",
6
+ version="1.0.8.1",
7
7
  packages=find_packages(),
8
8
  install_requires=[
9
9
  "msgspec"
@@ -1,8 +0,0 @@
1
- from .frameworks import FlaskManager as FlaskManager
2
- from .frameworks import DjangoManager as DjangoManager
3
- from .frameworks import FastapiManager as FastapiManager
4
-
5
- from .config import Config as Config
6
- from .config import AutoManager as AutoManager
7
-
8
- __version__ = '0.0.1'
@@ -1,6 +0,0 @@
1
- from .django import DjangoManager as DjangoManager
2
- from .flask import FlaskManager as FlaskManager
3
- from .fastapi import FastapiManager as FastapiManager
4
- from .template import Template as Template
5
-
6
- from .examples import *