tina4-python 0.2.152__tar.gz → 0.2.154__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 (56) hide show
  1. {tina4_python-0.2.152 → tina4_python-0.2.154}/.gitignore +1 -0
  2. {tina4_python-0.2.152 → tina4_python-0.2.154}/PKG-INFO +1 -1
  3. {tina4_python-0.2.152 → tina4_python-0.2.154}/pyproject.toml +1 -1
  4. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Queue.py +1 -1
  5. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/__init__.py +33 -28
  6. {tina4_python-0.2.152 → tina4_python-0.2.154}/README.md +0 -0
  7. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Api.py +0 -0
  8. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Auth.py +0 -0
  9. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/CRUD.py +0 -0
  10. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Constant.py +0 -0
  11. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Database.py +0 -0
  12. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/DatabaseResult.py +0 -0
  13. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/DatabaseTypes.py +0 -0
  14. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Debug.py +0 -0
  15. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Env.py +0 -0
  16. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/FieldTypes.py +0 -0
  17. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/HtmlElement.py +0 -0
  18. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Localization.py +0 -0
  19. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Messages.py +0 -0
  20. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/MiddleWare.py +0 -0
  21. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Migration.py +0 -0
  22. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/ORM.py +0 -0
  23. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Request.py +0 -0
  24. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Response.py +0 -0
  25. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Router.py +0 -0
  26. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Session.py +0 -0
  27. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/ShellColors.py +0 -0
  28. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Swagger.py +0 -0
  29. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Template.py +0 -0
  30. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Testing.py +0 -0
  31. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/WSDL.py +0 -0
  32. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Webserver.py +0 -0
  33. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/Websocket.py +0 -0
  34. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/cli.py +0 -0
  35. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/messages.pot +0 -0
  36. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/css/readme.md +0 -0
  37. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/favicon.ico +0 -0
  38. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/images/403.png +0 -0
  39. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/images/404.png +0 -0
  40. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/images/500.png +0 -0
  41. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/images/logo.png +0 -0
  42. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/images/readme.md +0 -0
  43. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/js/readme.md +0 -0
  44. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/js/reconnecting-websocket.js +0 -0
  45. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/js/tina4helper.js +0 -0
  46. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/swagger/index.html +0 -0
  47. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
  48. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/templates/components/crud.twig +0 -0
  49. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/templates/errors/403.twig +0 -0
  50. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/templates/errors/404.twig +0 -0
  51. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/templates/errors/500.twig +0 -0
  52. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/templates/readme.md +0 -0
  53. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
  54. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
  55. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
  56. {tina4_python-0.2.152 → tina4_python-0.2.154}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
@@ -38,3 +38,4 @@
38
38
  /data.db
39
39
  /test_queue.db-shm
40
40
  /publish.sh
41
+ /src/scss/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tina4-python
3
- Version: 0.2.152
3
+ Version: 0.2.154
4
4
  Summary: Tina4Python - This is not another framework for Python
5
5
  Author-email: Andre van Zuydam <andrevanzuydam@gmail.com>
6
6
  Requires-Python: <4.0,>=3.12
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tina4-python"
3
- version = "0.2.152"
3
+ version = "0.2.154"
4
4
  description = "Tina4Python - This is not another framework for Python"
5
5
  authors = [
6
6
  {name = "Andre van Zuydam",email = "andrevanzuydam@gmail.com"}
@@ -48,7 +48,7 @@ class Config:
48
48
  @dataclass(frozen=False)
49
49
  class Message:
50
50
  message_id: str
51
- data: str
51
+ data: str|dict
52
52
  user_id: str
53
53
  status: int
54
54
  time_stamp: int
@@ -239,54 +239,59 @@ else:
239
239
 
240
240
 
241
241
  def compile_scss():
242
- """Auto-compile ALL .scss filessingle compressed default.css (no default.scss needed)"""
242
+ """Auto-compile each main .scss fileits own .css file in mirrored public/css structure"""
243
243
  scss_dir = Path(root_path) / "src" / "scss"
244
- css_dir = Path(root_path) / "src" / "public" / "css"
245
- output_file = css_dir / "default.css"
244
+ css_base_dir = Path(root_path) / "src" / "public" / "css"
246
245
 
247
246
  if not scss_dir.exists():
248
247
  Debug.info("No src/scss folder — skipping SCSS compile")
249
248
  return
250
249
 
251
- # Find all .scss files (ignore _partials.scss unless imported)
250
+ # Find all .scss files
252
251
  scss_files = list(scss_dir.rglob("*.scss"))
253
252
  if not scss_files:
254
253
  Debug.info("No .scss files found — skipping")
255
254
  return
256
255
 
257
- css_dir.mkdir(parents=True, exist_ok=True)
256
+ # Identify main files (not starting with _)
257
+ main_files = [f for f in scss_files if not f.name.startswith("_")]
258
+
259
+ if not main_files:
260
+ Debug.info("No main .scss files (non-partials) found — nothing to compile")
261
+ return
258
262
 
259
263
  try:
260
- Debug.debug(f"Found {len(scss_files)} SCSS files compiling to default.css")
264
+ Debug.debug(f"Found {len(main_files)} main SCSS files to compile individually")
261
265
 
262
- # Build one big string with all content + @import for partials
263
- all_scss = ""
264
- partials = []
266
+ compiled_count = 0
267
+ for main_file in sorted(main_files):
268
+ # Compute relative path from scss_dir
269
+ rel_path = main_file.relative_to(scss_dir)
270
+ # Target CSS path: same structure, but .css extension
271
+ css_file = css_base_dir / rel_path.with_suffix(".css")
265
272
 
266
- for file in scss_files:
267
- if file.name.startswith("_"):
268
- partials.append(file.name)
269
- else:
270
- # Main files: add @import for partials + content
271
- content = file.read_text(encoding="utf-8")
272
- all_scss += f"/* === {file.name} === */\n{content}\n\n"
273
+ # Ensure parent directories exist
274
+ css_file.parent.mkdir(parents=True, exist_ok=True)
275
+
276
+ try:
277
+ # Compile using filename= (better relative import resolution)
278
+ compiled = sass.compile(
279
+ filename=str(main_file), # Key change: use filename instead of string
280
+ output_style="compressed",
281
+ include_paths=[str(scss_dir)] # Still needed for bare @import "partial";
282
+ )
273
283
 
274
- # Auto-import all partials at the top
275
- for partial in sorted(partials):
276
- all_scss = f"@import \"{partial}\";\n" + all_scss
284
+ css_file.write_text(compiled, encoding="utf-8")
285
+ compiled_count += 1
286
+ Debug.debug(f"Compiled {rel_path} {css_file.relative_to(root_path)} ({len(compiled)} bytes)")
277
287
 
278
- # Compile the whole thing
279
- compiled = sass.compile(
280
- string=all_scss,
281
- output_style='compressed',
282
- include_paths=[str(scss_dir)]
283
- )
288
+ except sass.CompileError as e:
289
+ Debug.error(f"Failed to compile {main_file}: {e}")
284
290
 
285
- output_file.write_text(compiled, encoding="utf-8")
286
- Debug.debug(f"Compiled {len(scss_files)} files → {output_file} ({len(compiled)} bytes)")
291
+ Debug.info(f"Successfully compiled {compiled_count}/{len(main_files)} main SCSS files to individual CSS")
287
292
 
288
293
  except Exception as e:
289
- Debug.error("SCSS auto-compile failed:", str(e))
294
+ Debug.error("Unexpected error during SCSS auto-compile:", str(e))
290
295
 
291
296
  # Run it on startup
292
297
  compile_scss()
File without changes