rapidframework-lib 1.0.8.1__tar.gz → 1.0.8.2__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 (49) hide show
  1. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/PKG-INFO +2 -2
  2. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/README.md +1 -1
  3. rapidframework_lib-1.0.8.2/rapidframework/frameworks/django.py +33 -0
  4. rapidframework_lib-1.0.8.2/rapidframework/frameworks/fastapi.py +11 -0
  5. rapidframework_lib-1.0.8.2/rapidframework/frameworks/simple_frameworks.py +29 -0
  6. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/main.py +5 -8
  7. rapidframework_lib-1.0.8.2/rapidframework/template.py +79 -0
  8. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/PKG-INFO +2 -2
  9. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/SOURCES.txt +1 -11
  10. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/setup.py +1 -1
  11. rapidframework_lib-1.0.8.1/rapidframework/frameworks/bottle.py +0 -10
  12. rapidframework_lib-1.0.8.1/rapidframework/frameworks/cherrypy.py +0 -10
  13. rapidframework_lib-1.0.8.1/rapidframework/frameworks/django.py +0 -25
  14. rapidframework_lib-1.0.8.1/rapidframework/frameworks/fastapi.py +0 -17
  15. rapidframework_lib-1.0.8.1/rapidframework/frameworks/flask.py +0 -10
  16. rapidframework_lib-1.0.8.1/rapidframework/frameworks/grok.py +0 -11
  17. rapidframework_lib-1.0.8.1/rapidframework/frameworks/litestar.py +0 -6
  18. rapidframework_lib-1.0.8.1/rapidframework/frameworks/pyramid.py +0 -11
  19. rapidframework_lib-1.0.8.1/rapidframework/frameworks/socketify.py +0 -11
  20. rapidframework_lib-1.0.8.1/rapidframework/frameworks/starlette.py +0 -9
  21. rapidframework_lib-1.0.8.1/rapidframework/frameworks/tornado.py +0 -7
  22. rapidframework_lib-1.0.8.1/rapidframework/frameworks/turbogears2.py +0 -10
  23. rapidframework_lib-1.0.8.1/rapidframework/frameworks/web2py.py +0 -6
  24. rapidframework_lib-1.0.8.1/rapidframework/template.py +0 -55
  25. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/LICENSE +0 -0
  26. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/pyproject.toml +0 -0
  27. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/__init__.py +0 -0
  28. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/__pycache__/main.cpython-313.pyc +0 -0
  29. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/config.py +0 -0
  30. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/configs/managers.json +0 -0
  31. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/__init__.py +0 -0
  32. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/__init__.py +0 -0
  33. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/bottle_1.py +0 -0
  34. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/cherrypy_1.py +0 -0
  35. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/fastapi_1.py +0 -0
  36. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/flask_1.py +0 -0
  37. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/grok_1.py +0 -0
  38. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/litestar_1.py +0 -0
  39. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/pyramid_1.py +0 -0
  40. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/socketify_1.py +0 -0
  41. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/starlette_1.py +0 -0
  42. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/tornado_1.py +0 -0
  43. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/turbogears2_1.py +0 -0
  44. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework/frameworks/examples/web2py_1.py +0 -0
  45. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/dependency_links.txt +0 -0
  46. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/entry_points.txt +0 -0
  47. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/requires.txt +0 -0
  48. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/rapidframework_lib.egg-info/top_level.txt +0 -0
  49. {rapidframework_lib-1.0.8.1 → rapidframework_lib-1.0.8.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rapidframework-lib
3
- Version: 1.0.8.1
3
+ Version: 1.0.8.2
4
4
  Description-Content-Type: text/markdown
5
5
  License-File: LICENSE
6
6
  Requires-Dist: msgspec
@@ -31,7 +31,7 @@ rapidframework fastapi --name App --version 0.115.12 --example 1
31
31
 
32
32
  ## Features
33
33
 
34
- - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**.
34
+ - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**, etc.
35
35
  - 🎨 Support for custom templates via the `Template` class.
36
36
  - 🚀 Built-in examples to get started quickly.
37
37
 
@@ -20,7 +20,7 @@ rapidframework fastapi --name App --version 0.115.12 --example 1
20
20
 
21
21
  ## Features
22
22
 
23
- - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**.
23
+ - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**, etc.
24
24
  - 🎨 Support for custom templates via the `Template` class.
25
25
  - 🚀 Built-in examples to get started quickly.
26
26
 
@@ -0,0 +1,33 @@
1
+ # from ..template import Template
2
+ # from subprocess import run
3
+ # from os import chdir
4
+
5
+
6
+ # class DjangoManager(Template):
7
+ # extra_libs = ["Pillow"]
8
+ # example = False
9
+
10
+ # def run_manage(self, commands: list):
11
+ # manage_py = f"{self.source_dir}/{self.project_name}/manage.py"
12
+ # for command in commands:
13
+ # full_command = ["python", manage_py] + command.strip().split(" ")
14
+ # run(full_command, check=True)
15
+
16
+ # def setup_framework(self):
17
+ # run([
18
+ # "python", "-m", "django", "startproject",
19
+ # self.project_name, self.source_dir
20
+ # ], check=True)
21
+
22
+ # chdir(f"{self.source_dir}/{self.project_name}")
23
+ # self.run_manage([f"startapp {self.name}", "makemigrations", "migrate"])
24
+
25
+ # self.extra_files.append(f"{self.project_name}/{self.name}/urls.py")
26
+
27
+ # return super().setup_framework(
28
+ # source_dir=f"{self.source_dir}/{self.project_name}/{self.name}",
29
+ # extra_files=self.extra_files
30
+ # )
31
+ """
32
+ The class is being redeveloped for better performance and capabilities
33
+ """
@@ -0,0 +1,11 @@
1
+ from ..template import Template
2
+
3
+ class FastapiManager(Template):
4
+ extra_libs = ["sqlalchemy", "python-multipart", "databases", "python-multipart", "aiofiles", "uvicorn", "jinja2", "bcrypt"]
5
+ extra_dirs = ["db"]
6
+
7
+ class StarletteManager(FastapiManager):
8
+ extra_libs = ["aiomysql"]
9
+
10
+ class LitestarManager(StarletteManager):
11
+ extra_libs = ["msgspec", "starlette", "httpx"]
@@ -0,0 +1,29 @@
1
+ from ..template import Template
2
+
3
+ class PyramidManager(Template):
4
+ extra_libs = ["sqlalchemy", "alembic", "pyramid_tm", "pyramid_jinja2", "pyramid_authsanity"]
5
+
6
+ class TornadoManager(Template):
7
+ extra_libs = ["motor", "aiomysql", "pytest-tornado", "aiofiles"]
8
+
9
+ class Web2pyManager(Template): ...
10
+
11
+ class GrokManager(Template):
12
+ extra_libs = ["z3c.sqlalchemy", "zope.sqlalchemy", "alembic"]
13
+
14
+ class FlaskManager(Template):
15
+ extra_libs = ["flask_sqlalchemy", "flask_migrate", "flask_wtf", "flask_login"]
16
+ extra_dirs = ["db"]
17
+
18
+ class CherryPyManager(Template):
19
+ extra_libs = ["sqlalchemy", "alembic", "Jinja2", "authlib"]
20
+
21
+ class BottleManager(Template):
22
+ extra_libs = ["sqlalchemy", "bottle-sqlalchemy", "alembic", "bottle-login", "wtforms"]
23
+ extra_libs = ["db"]
24
+
25
+ class SocketifyManager(Template):
26
+ extra_libs = ["ormar", "databases", "pydantic", "jinja2", "authlib"]
27
+
28
+ class TurboGears2Manager(Template):
29
+ extra_libs = ["sqlalchemy", "alembic", "tgext.auth", "tgext.admin"]
@@ -43,23 +43,20 @@ class Main:
43
43
  #
44
44
  self.args = self.parser.parse_args()
45
45
  #
46
- self.framework_manager = self._load_framework_manager()
46
+ self.framework_manager = find_manager_class(self.args.framework)
47
47
 
48
48
  def _discover_frameworks(self):
49
49
  return sorted(set([cls.__name__.removesuffix("Manager").lower() for cls in all_subclasses(Template)]))
50
50
 
51
- def _load_framework_manager(self):
52
- return find_manager_class(self.args.framework)(name=self.args.name)
53
-
54
51
  def run(self):
55
52
  example_id = 1 if self.args.example is None else self.args.example
56
53
  #
54
+ framework = self.framework_manager(self.args.name)
55
+ #
57
56
  if hasattr(self.framework_manager, "install_framework"):
58
- self.framework_manager.install_framework(version=self.args.version)
59
-
57
+ framework.install_framework(version=self.args.version)
60
58
  if hasattr(self.framework_manager, "create_example"):
61
- self.framework_manager.create_example(self.args.name, example_id)
62
-
59
+ framework.create_example(example_id)
63
60
 
64
61
  def main_entry_point():
65
62
  Main().run()
@@ -0,0 +1,79 @@
1
+ from os import path
2
+ from .config import AutoManager
3
+ from .config import Config
4
+ from typing import Optional, List
5
+
6
+ cfg = Config()
7
+
8
+ class Template:
9
+ extra_libs: List[str] = []
10
+ extra_dirs: List[str] = []
11
+ extra_files: List[str] = []
12
+ example: bool = True
13
+
14
+ def __init_subclass__(cls, **kwargs):
15
+ super().__init_subclass__(**kwargs)
16
+ cls.framework_name = cls.__name__.lower().replace("manager", "")
17
+
18
+ bases = [base for base in cls.__mro__[1:] if issubclass(base, Template)]
19
+
20
+ cls.extra_libs = sum([getattr(base, "extra_libs", []) for base in reversed(bases)], []) + cls.extra_libs
21
+ cls.extra_dirs = sum([getattr(base, "extra_dirs", []) for base in reversed(bases)], []) + cls.extra_dirs
22
+ cls.extra_files = sum([getattr(base, "extra_files", []) for base in reversed(bases)], []) + cls.extra_files
23
+
24
+ cls.example = getattr(cls, "example", True)
25
+
26
+ def __init__(
27
+ self,
28
+ name: str,
29
+ framework_name: Optional[str] = None,
30
+ source_dir = cfg.source_dir,
31
+ project_name = cfg.project_name
32
+ ):
33
+ self.name = name
34
+ self.framework_name = framework_name or self.__class__.framework_name
35
+ self.source_dir = source_dir
36
+ self.project_name = project_name
37
+ self.AutoManager = AutoManager()
38
+ self.extra_libs = self.__class__.extra_libs
39
+ self.extra_dirs = self.__class__.extra_dirs
40
+ self.extra_files = self.__class__.extra_files
41
+ self.example = self.__class__.example
42
+
43
+ def install_framework(self, **kwargs):
44
+ version = f"=={kwargs.get('version')}" if kwargs.get('version') else ""
45
+ libs_to_install: list = kwargs.get("libs") or []
46
+ #
47
+ libs_to_install.extend([f"{self.framework_name}{version}"])
48
+ libs_to_install.extend(self.extra_libs)
49
+ #
50
+ self.AutoManager.install_libs(libs_to_install)
51
+ #
52
+ self.setup_framework()
53
+
54
+ def setup_framework(self, source_dir: list = None, extra_dirs: list = None, extra_files: list = None):
55
+ source_dir = source_dir or self.source_dir
56
+ #
57
+ dirs = (extra_dirs or []) + self.extra_dirs
58
+ files = (extra_files or []) + self.extra_files
59
+ #
60
+ if dirs:
61
+ cfg.create_dirs(source_dir, dirs)
62
+ if files:
63
+ cfg.create_files(files)
64
+
65
+ def create_example(self, example_id):
66
+ if self.__class__.example:
67
+ from pkgutil import get_data
68
+
69
+ example_code = get_data(
70
+ "rapidframework",
71
+ f"frameworks/examples/{self.framework_name}_{example_id}.py",
72
+ ).decode("utf-8")
73
+
74
+ with open(
75
+ path.join(self.source_dir, self.name + ".py"), "w", encoding="utf-8"
76
+ ) as example_file:
77
+ example_file.write(example_code)
78
+ else:
79
+ raise Exception("Example method is'n allowed for this framework !")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rapidframework-lib
3
- Version: 1.0.8.1
3
+ Version: 1.0.8.2
4
4
  Description-Content-Type: text/markdown
5
5
  License-File: LICENSE
6
6
  Requires-Dist: msgspec
@@ -31,7 +31,7 @@ rapidframework fastapi --name App --version 0.115.12 --example 1
31
31
 
32
32
  ## Features
33
33
 
34
- - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**.
34
+ - 📦 Create projects based on popular frameworks: **Flask**, **Django**, **FastAPI**, etc.
35
35
  - 🎨 Support for custom templates via the `Template` class.
36
36
  - 🚀 Built-in examples to get started quickly.
37
37
 
@@ -9,19 +9,9 @@ rapidframework/template.py
9
9
  rapidframework/__pycache__/main.cpython-313.pyc
10
10
  rapidframework/configs/managers.json
11
11
  rapidframework/frameworks/__init__.py
12
- rapidframework/frameworks/bottle.py
13
- rapidframework/frameworks/cherrypy.py
14
12
  rapidframework/frameworks/django.py
15
13
  rapidframework/frameworks/fastapi.py
16
- rapidframework/frameworks/flask.py
17
- rapidframework/frameworks/grok.py
18
- rapidframework/frameworks/litestar.py
19
- rapidframework/frameworks/pyramid.py
20
- rapidframework/frameworks/socketify.py
21
- rapidframework/frameworks/starlette.py
22
- rapidframework/frameworks/tornado.py
23
- rapidframework/frameworks/turbogears2.py
24
- rapidframework/frameworks/web2py.py
14
+ rapidframework/frameworks/simple_frameworks.py
25
15
  rapidframework/frameworks/examples/__init__.py
26
16
  rapidframework/frameworks/examples/bottle_1.py
27
17
  rapidframework/frameworks/examples/cherrypy_1.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="rapidframework-lib",
6
- version="1.0.8.1",
6
+ version="1.0.8.2",
7
7
  packages=find_packages(),
8
8
  install_requires=[
9
9
  "msgspec"
@@ -1,10 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class BottleManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["sqlalchemy", "bottle-sqlalchemy", "alembic", "bottle-login", "wtforms"], **kwargs)
@@ -1,10 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class CherryPyManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["sqlalchemy", "alembic", "Jinja2", "authlib"], **kwargs)
@@ -1,25 +0,0 @@
1
- from ..template import Template
2
- from subprocess import run
3
- from os import chdir
4
-
5
-
6
- class DjangoManager(Template):
7
- def __init__(self, **kwargs):
8
- super().__init__(**kwargs)
9
-
10
- def run_manage(self, commands: list):
11
- chdir(f"{self.source_dir}/{self.project_name}")
12
- for command in commands:
13
- run(("uv run manage.py " + command.strip()).split(" "))
14
-
15
- def setup_framework(self):
16
- run(["uvx", "--from", "django", "django-admin", "startproject", self.project_name])
17
- self.run_manage([f"startapp {self.name}", "makemigrations", "migrate"])
18
- return super().setup_framework(f"{self.source_dir}/{self.project_name}/{self.name}", \
19
- extra_files=[f"{self.project_name}/{self.name}/urls.py"])
20
-
21
- def install_framework(self, **kwargs):
22
- return super().install_framework(libs=["Pillow"], **kwargs)
23
-
24
- def create_example(self, name, example_id) -> None:
25
- return None
@@ -1,17 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class FastapiManager(Template):
5
- def __init__(self, extra_libs: list = \
6
- ["sqlalchemy", "databases", "python-multipart", "aiofiles"], **kwargs):
7
-
8
- self.extra_libs = extra_libs
9
- super().__init__(**kwargs)
10
-
11
- def setup_framework(self, extra_dirs=["db"]):
12
- return super().setup_framework(extra_dirs=extra_dirs)
13
-
14
- def install_framework(self, **kwargs):
15
- self.extra_libs.extend(["uvicorn", "jinja2", "bcrypt"])
16
- return super().install_framework(libs=\
17
- self.extra_libs, **kwargs)
@@ -1,10 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class FlaskManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["flask_sqlalchemy", "flask_migrate", "flask_wtf", "flask_login"], **kwargs)
@@ -1,11 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class GrokManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["z3c.sqlalchemy", "zope.sqlalchemy", "alembic"], **kwargs)
11
-
@@ -1,6 +0,0 @@
1
- from .starlette import StarletteManager
2
-
3
- class LitestarManager(StarletteManager):
4
- def __init__(self, extra_libs=None, **kwargs):
5
- extra_libs = (extra_libs or []) + ["msgspec", "starlette", "httpx"]
6
- super().__init__(extra_libs=extra_libs, **kwargs)
@@ -1,11 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class PyramidManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["sqlalchemy", "alembic", "pyramid_tm", "pyramid_jinja2", "pyramid_authsanity"], **kwargs)
11
-
@@ -1,11 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class SocketifyManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["ormar", "databases", "pydantic", "jinja2", "authlib"], **kwargs)
11
-
@@ -1,9 +0,0 @@
1
- from .fastapi import FastapiManager
2
-
3
-
4
- class StarletteManager(FastapiManager):
5
- def __init__(self, extra_libs = \
6
- ["sqlalchemy", "aiomysql", "python-multipart", "aiofiles"], **kwargs):
7
-
8
- self.extra_libs = extra_libs
9
- super().__init__(extra_libs, **kwargs)
@@ -1,7 +0,0 @@
1
- from .fastapi import FastapiManager
2
-
3
-
4
- class TornadoManager(FastapiManager):
5
- def __init__(self, extra_libs = \
6
- ["motor", "aiomysql", "pytest-tornado", "aiofiles"], **kwargs):
7
- super().__init__(extra_libs, **kwargs)
@@ -1,10 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class TurboGears2Manager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
7
-
8
- def install_framework(self, **kwargs):
9
- return super().install_framework(libs=\
10
- ["sqlalchemy", "alembic", "tgext.auth", "tgext.admin"], **kwargs)
@@ -1,6 +0,0 @@
1
- from ..template import Template
2
-
3
-
4
- class Web2pyManager(Template):
5
- def __init__(self, **kwargs):
6
- super().__init__(**kwargs)
@@ -1,55 +0,0 @@
1
- from os import path
2
- from .config import AutoManager
3
- from .config import Config
4
-
5
-
6
- cfg = Config()
7
-
8
-
9
- class Template:
10
- def __init__(
11
- self,
12
- framework_name: str | None = None,
13
- source_dir=cfg.source_dir,
14
- project_name=cfg.project_name,
15
- **kwargs
16
- ):
17
- if framework_name is None:
18
- self.framework_name = self.__class__.__name__.lower().replace("manager", "")
19
- else:
20
- self.framework_name = framework_name
21
- #
22
- self.source_dir = source_dir
23
- self.project_name = project_name
24
- self.name = kwargs.get("name")
25
- #
26
- self.AutoManager = AutoManager()
27
- #
28
-
29
- def install_framework(self, **kwargs):
30
- version = f"=={kwargs.get('version')}" if kwargs.get('version') else ""
31
- libs_to_install: list = kwargs.get("libs") or []
32
- #
33
- libs_to_install.extend([f"{self.framework_name}{version}"])
34
- print("Getting libs")
35
- self.AutoManager.install_libs(libs_to_install)
36
- #
37
- self.setup_framework()
38
-
39
- def setup_framework(self, source_dir=cfg.source_dir, extra_dirs=[], extra_files: list=None):
40
- cfg.create_dirs(source_dir, extra_dirs)
41
- if extra_files is not None:
42
- cfg.create_files(extra_files)
43
-
44
- def create_example(self, name, example_id):
45
- from pkgutil import get_data
46
-
47
- example_code = get_data(
48
- "rapidframework",
49
- f"frameworks/examples/{self.framework_name}_{example_id}.py",
50
- ).decode("utf-8")
51
-
52
- with open(
53
- path.join(cfg.source_dir, name + ".py"), "w", encoding="utf-8"
54
- ) as example_file:
55
- example_file.write(example_code)