tina4-python 0.2.24__tar.gz → 0.2.26__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 (46) hide show
  1. {tina4_python-0.2.24 → tina4_python-0.2.26}/PKG-INFO +1 -1
  2. {tina4_python-0.2.24 → tina4_python-0.2.26}/pyproject.toml +1 -1
  3. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/.env +1 -0
  4. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Debug.py +2 -1
  5. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Response.py +8 -9
  6. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Router.py +7 -2
  7. tina4_python-0.2.26/tina4_python/logs/debug.log +1066 -0
  8. tina4_python-0.2.26/tina4_python/test.db +0 -0
  9. {tina4_python-0.2.24 → tina4_python-0.2.26}/README.md +0 -0
  10. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Auth.py +0 -0
  11. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Constant.py +0 -0
  12. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Database.py +0 -0
  13. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/DatabaseResult.py +0 -0
  14. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Env.py +0 -0
  15. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Localization.py +0 -0
  16. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Messages.py +0 -0
  17. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/MiddleWare.py +0 -0
  18. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Migration.py +0 -0
  19. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Request.py +0 -0
  20. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Session.py +0 -0
  21. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/ShellColors.py +0 -0
  22. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Swagger.py +0 -0
  23. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Template.py +0 -0
  24. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/Webserver.py +0 -0
  25. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/__init__.py +0 -0
  26. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/messages.pot +0 -0
  27. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/css/readme.md +0 -0
  28. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/favicon.ico +0 -0
  29. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/images/403.png +0 -0
  30. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/images/404.png +0 -0
  31. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/images/logo.png +0 -0
  32. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/images/readme.md +0 -0
  33. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/js/readme.md +0 -0
  34. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/js/tina4helper.js +0 -0
  35. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/swagger/index.html +0 -0
  36. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
  37. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/secrets/domain.cert +0 -0
  38. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/secrets/private.key +0 -0
  39. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/secrets/public.key +0 -0
  40. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/templates/errors/403.twig +0 -0
  41. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/templates/errors/404.twig +0 -0
  42. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/templates/readme.md +0 -0
  43. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
  44. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
  45. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
  46. {tina4_python-0.2.24 → tina4_python-0.2.26}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tina4-python
3
- Version: 0.2.24
3
+ Version: 0.2.26
4
4
  Summary: Tina4Python - This is not another framework for Python
5
5
  Author: Andre van Zuydam
6
6
  Author-email: andrevanzuydam@gmail.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "tina4-python"
3
- version = "0.2.24"
3
+ version = "0.2.26"
4
4
  description = "Tina4Python - This is not another framework for Python"
5
5
  authors = ["Andre van Zuydam <andrevanzuydam@gmail.com>"]
6
6
  readme = "README.md"
@@ -4,3 +4,4 @@ VERSION=1.0.0
4
4
  TINA4_LANGUAGE=en
5
5
  TINA4_SECRET=ABCDEF
6
6
  TINA4_DEBUG_LEVEL=[TINA4_LOG_ALL]
7
+ API_KEY=f9ca99e18c7bce9c6852df4257a3280b
@@ -66,7 +66,8 @@ class Debug:
66
66
  print(output, "", end="")
67
67
  print()
68
68
 
69
- sys.stdout.flush()
69
+ if sys.stdout is not None:
70
+ sys.stdout.flush()
70
71
 
71
72
  handler.flush()
72
73
  logger.removeHandler(handler)
@@ -16,21 +16,19 @@ content = ""
16
16
  http_code = Constant.HTTP_OK
17
17
  content_type = Constant.TEXT_HTML
18
18
 
19
+
19
20
  class Response:
20
21
  def __init__(self, content_in=None, http_code_in=None, content_type_in=None,
21
- headers_in=None):
22
+ headers_in=None):
22
23
  global headers
23
24
  global content
24
25
  global http_code
25
26
  global content_type
26
27
 
27
- if content is not None:
28
- content_in = content + content_in
29
-
30
28
  if (not isinstance(content_in, bool) and not isinstance(content_in, object)
31
- and not isinstance(content_in,bytes)
32
- and not isinstance(content_in, str)
33
- and not isinstance(content_in, list) and inspect.isclass(type(content_in))):
29
+ and not isinstance(content_in, bytes)
30
+ and not isinstance(content_in, str)
31
+ and not isinstance(content_in, list) and inspect.isclass(type(content_in))):
34
32
  content_in = dict(content_in)
35
33
 
36
34
  # check if database result
@@ -53,6 +51,9 @@ class Response:
53
51
  content_in = json.dumps({"error": "Cannot decode object of type " + str(type(content_in))})
54
52
  content_type = Constant.APPLICATION_JSON
55
53
 
54
+ if content is not None and isinstance(content_in, str):
55
+ content_in = content + content_in
56
+
56
57
  self.headers = headers_in if headers_in is not None else headers
57
58
  self.content = content_in if content_in is not None else content
58
59
  self.http_code = http_code_in if http_code_in is not None else http_code
@@ -90,5 +91,3 @@ class Response:
90
91
  """
91
92
  global headers
92
93
  headers[key] = value
93
-
94
-
@@ -66,6 +66,7 @@ class Router:
66
66
  Response.headers = {}
67
67
  Response.content = ""
68
68
  Response.http_code = Constant.HTTP_OK
69
+ Response.content_type = Constant.TEXT_HTML
69
70
  result = None
70
71
 
71
72
  Debug("Root Path " + tina4_python.root_path + " " + url, method, Constant.TINA4_LOG_DEBUG)
@@ -121,6 +122,7 @@ class Router:
121
122
  return Response.Response(file.read(), Constant.HTTP_OK, mime_type)
122
123
 
123
124
  old_stdout = None
125
+ buffer = io.StringIO()
124
126
  for route in tina4_python.tina4_routes.values():
125
127
  if route["method"] != method:
126
128
  continue
@@ -178,7 +180,6 @@ class Router:
178
180
  if not route["cache"]["cached"]:
179
181
  result.headers["Cache-Control"] = "max-age=1, must-revalidate"
180
182
  result.headers["Pragma"] = "no-cache"
181
- result.headers["Clear-Site-Data"] = "cache"
182
183
  else:
183
184
  result.headers["Cache-Control"] = "max-age=" + str(
184
185
  route["cache"]["max_age"]) + ", must-revalidate"
@@ -190,7 +191,11 @@ class Router:
190
191
  break
191
192
 
192
193
  if result is None:
193
- sys.stdout = old_stdout
194
+ if old_stdout is not None:
195
+ sys.stdout = old_stdout
196
+ else:
197
+ sys.stdout = buffer = io.StringIO()
198
+
194
199
  try:
195
200
  return Response.Response(json.loads(buffer.getvalue()), Constant.HTTP_OK, Constant.APPLICATION_JSON)
196
201
  except: