jknife 0.0.6__py2.py3-none-any.whl → 0.0.8__py2.py3-none-any.whl

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.
jknife/commands/jknife.py CHANGED
@@ -35,8 +35,7 @@ from typing_extensions import Annotated, Doc
35
35
  """
36
36
 
37
37
  # Template for routers/APP_NAME.py
38
- MODULE_IMPORT_STRING_ROUTERS: str = """
39
- # import packages from default or pip library
38
+ MODULE_IMPORT_STRING_ROUTERS: str = """# import packages from default or pip library
40
39
  from fastapi import APIRouter, Depends, status, HTTPException
41
40
  from typing_extensions import Annotated, Doc
42
41
 
@@ -44,14 +43,14 @@ from typing_extensions import Annotated, Doc
44
43
 
45
44
 
46
45
  # set CONSTANT variables below.
47
-
46
+ router = APIRouter(prefix="/{}",
47
+ tags=['{}'])
48
48
 
49
49
  # define your own customising class below
50
50
  """
51
51
 
52
52
  # Template for views/APP_NAME.py
53
- MODULE_IMPORT_STRING_VIEWS: str = """
54
- # import packages from default or pip library
53
+ MODULE_IMPORT_STRING_VIEWS: str = """# import packages from default or pip library
55
54
  from pydantic import BaseModel
56
55
 
57
56
  # import packages from this framework below
@@ -273,13 +272,12 @@ async def validation_error(req: Request, exc: RequestValidationError):
273
272
 
274
273
 
275
274
  # add routers_bak
276
- for router in os.listdir(os.path.abspath(path="routers_bak")):
275
+ for router in os.listdir(os.path.abspath(path="routers")):
277
276
  if not router.startswith("__"):
278
- tmp_module = importlib.import_module(name=f"routers_bak.{router.split('.')[0]}")
277
+ tmp_module = importlib.import_module(name=f"routers.{router.split('.')[0]}")
279
278
  app.include_router(router=tmp_module.router,
280
279
  prefix=MAIN_URL)
281
280
 
282
-
283
281
  """
284
282
 
285
283
 
@@ -331,7 +329,7 @@ def createapp(app_name: str) -> None:
331
329
  f.write(MODULE_IMPORT_STRING_MODELS)
332
330
 
333
331
  with open(f"routers/{app_name}.py", "w") as f:
334
- f.write(MODULE_IMPORT_STRING_ROUTERS)
332
+ f.write(MODULE_IMPORT_STRING_ROUTERS.format(app_name, app_name))
335
333
 
336
334
  with open(f"views/{app_name}.py", "w") as f:
337
335
  f.write(MODULE_IMPORT_STRING_VIEWS)
jknife/logging.py CHANGED
@@ -6,7 +6,7 @@ from settings import LOG_SETTINGS, DEBUG_MODE
6
6
 
7
7
 
8
8
  # create logs folder to store log files.
9
- if "logs" not in listdir(""):
9
+ if "logs" not in listdir():
10
10
  mkdir("logs")
11
11
 
12
12
  # set logging config from settings.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jknife
3
- Version: 0.0.6
3
+ Version: 0.0.8
4
4
  Summary: Custom FastAPI for luna-negra
5
5
  Author: luna-negra
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
1
  jknife/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- jknife/logging.py,sha256=0MVIdLEYE2hpaRHhjbS20hFKIFXVJVVDzqyJmUU8_HQ,2314
2
+ jknife/logging.py,sha256=vwXXYqiRDRSeAUtDZq6QTTJ5p7ES4iLdnS68Cz0MFgo,2312
3
3
  jknife/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- jknife/commands/jknife.py,sha256=Yx5wWwqAwdKEVqNGn5YVQQC_ew2k8d35uxwQNyWwhCI,11677
4
+ jknife/commands/jknife.py,sha256=Uz1RPczM9WqPoH0PKNLuWpZdhRyjdIU51nTgXeeIWJQ,11757
5
5
  jknife/db/__init__.py,sha256=lZQ1ds_BYK4Xkjaypn1zDxuypjdEKca-6uxSJ3mr0V4,6236
6
6
  jknife/db/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  jknife/db/models/mongo/__init__.py,sha256=bDj6rFEtNudrbtPbk4iORlWwXyMv6V_PCeixyGufxP4,1984
@@ -24,8 +24,8 @@ jknife/views/error_message.py,sha256=g3xS8Z0R1BeP9XpmETgLirDdghM789iGXBfU-K8wwWM
24
24
  jknife/views/personnel_info.py,sha256=JL_GqerZjhgs4AJQsQ2eeUZxCh17G8zXuWsDqaEI2tk,957
25
25
  jknife/views/tokens.py,sha256=PJh_fGEwK3T6Kq0aY-CuJPWCTdcHFrCSd2NhJMZqYqU,647
26
26
  jknife/views/users.py,sha256=ndbSTMlEeiwazfejHrGj37Jnw-e40Y6YoZwzyyyM4ns,2041
27
- jknife-0.0.6.dist-info/METADATA,sha256=zeZrhl1QDctt1fodUZQHobz1kVu3nQ4RNHidCH7qwdo,528
28
- jknife-0.0.6.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
29
- jknife-0.0.6.dist-info/entry_points.txt,sha256=08tkSuEw5jKr7Jz0cFlcKr8b2fjsQIf4Mzmb0cB8XOM,55
30
- jknife-0.0.6.dist-info/licenses/LICENSE,sha256=myY0xrsHJcytQadTeGVqmIo6QlskAAf5epHL-WRQe30,1067
31
- jknife-0.0.6.dist-info/RECORD,,
27
+ jknife-0.0.8.dist-info/METADATA,sha256=eTsvfnEq40nBbG6pBf6JTxzowsKZkaX9Wysbl9SVYTw,528
28
+ jknife-0.0.8.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
29
+ jknife-0.0.8.dist-info/entry_points.txt,sha256=08tkSuEw5jKr7Jz0cFlcKr8b2fjsQIf4Mzmb0cB8XOM,55
30
+ jknife-0.0.8.dist-info/licenses/LICENSE,sha256=myY0xrsHJcytQadTeGVqmIo6QlskAAf5epHL-WRQe30,1067
31
+ jknife-0.0.8.dist-info/RECORD,,
File without changes