dmart 1.4.40__py3-none-any.whl → 1.4.40.post2__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.
dmart/cli.py CHANGED
@@ -932,8 +932,7 @@ def action(text: str):
932
932
  idx += 1
933
933
  finally:
934
934
  termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
935
- return None
936
- # c = input("q: quite, b: previous, n: next = ")
935
+ # c = input("q: quite, b: previous, n: next = ")
937
936
  # print(tree)
938
937
  dmart.current_space, dmart.current_subpath = old_space, old_subpath
939
938
  dmart.list()
@@ -988,8 +987,8 @@ def _(event):
988
987
  event.current_buffer.validate_and_handle()
989
988
 
990
989
 
991
- if __name__ == "__main__":
992
- try :
990
+ def main():
991
+ try:
993
992
  # print(Panel.fit("For help, type : [bold]?[/]", title="DMart Cli"))
994
993
  print("[bold][green]DMART[/] [yellow]Command line interface[/][/]")
995
994
  print(
@@ -1019,6 +1018,7 @@ if __name__ == "__main__":
1019
1018
  key_bindings=key_bindings
1020
1019
  )
1021
1020
 
1021
+ global mode
1022
1022
  if len(sys.argv) >= 2:
1023
1023
  if sys.argv[1] == "s":
1024
1024
  mode = CLI_MODE.SCRIPT
@@ -1031,8 +1031,34 @@ if __name__ == "__main__":
1031
1031
  else:
1032
1032
  check_update_space(sys.argv[2])
1033
1033
  del sys.argv[2]
1034
- del sys.argv[0]
1035
- del sys.argv[0]
1034
+ del sys.argv[0]
1035
+ del sys.argv[0]
1036
+ elif sys.argv[1] == "cli":
1037
+ # When called via 'dmart cli ...'
1038
+ if len(sys.argv) >= 3:
1039
+ if sys.argv[2] == "s":
1040
+ mode = CLI_MODE.SCRIPT
1041
+ del sys.argv[0] # dmart
1042
+ del sys.argv[0] # cli
1043
+ del sys.argv[0] # s
1044
+ elif sys.argv[2] == "c":
1045
+ mode = CLI_MODE.CMD
1046
+ if len(sys.argv) >= 5 and sys.argv[4].startswith("/"):
1047
+ check_update_space(sys.argv[3], sys.argv[4])
1048
+ del sys.argv[3]
1049
+ del sys.argv[3]
1050
+ elif len(sys.argv) >= 4:
1051
+ check_update_space(sys.argv[3])
1052
+ del sys.argv[3]
1053
+ del sys.argv[0] # dmart
1054
+ del sys.argv[0] # cli
1055
+ del sys.argv[0] # c
1056
+ else:
1057
+ del sys.argv[0]
1058
+ del sys.argv[0]
1059
+ else:
1060
+ del sys.argv[0]
1061
+ del sys.argv[0]
1036
1062
 
1037
1063
  if mode == CLI_MODE.CMD:
1038
1064
  print(sys.argv)
@@ -1099,5 +1125,9 @@ if __name__ == "__main__":
1099
1125
  # else:
1100
1126
  # print('You entered:', repr(text))
1101
1127
  print("[yellow]Good bye![/]")
1102
- except requests.exceptions.ConnectionError as _ :
1103
- print("[yellow]Connection error[/]")
1128
+ except requests.exceptions.ConnectionError as _ :
1129
+ print("[yellow]Connection error[/]")
1130
+
1131
+
1132
+ if __name__ == "__main__":
1133
+ main()
dmart/dmart.py CHANGED
@@ -440,6 +440,7 @@ def main():
440
440
  os.environ["BACKEND_ENV"] = config_file
441
441
 
442
442
  # Try to find cli.py in the package or nearby
443
+ last_import_error = None
443
444
  try:
444
445
  # When installed as a package, cli.py is in the same directory as dmart.py
445
446
  dmart_dir = Path(__file__).resolve().parent
@@ -447,16 +448,38 @@ def main():
447
448
  sys.path.append(str(dmart_dir))
448
449
  import cli
449
450
  cli.main()
450
- except ImportError:
451
- # Fallback for local development
452
- cli_path = Path(__file__).resolve().parent.parent / "cli"
453
- if cli_path.exists():
454
- sys.path.append(str(cli_path))
451
+ return
452
+ except ImportError as e:
453
+ last_import_error = e
454
+ if e.name and e.name != 'cli':
455
+ print(f"Error: Missing dependency for CLI: {e}")
456
+ sys.exit(1)
457
+ except Exception as e:
458
+ print(f"Error: Failed to start CLI: {e}")
459
+ sys.exit(1)
460
+
461
+ # Fallback for local development
462
+ cli_path = Path(__file__).resolve().parent.parent / "cli"
463
+ if cli_path.exists():
464
+ sys.path.append(str(cli_path))
465
+ try:
455
466
  import cli
456
467
  cli.main()
457
- else:
458
- print("Error: cli.py not found.")
468
+ return
469
+ except ImportError as e:
470
+ last_import_error = e
471
+ if e.name and e.name != 'cli':
472
+ print(f"Error: Missing dependency for CLI: {e}")
473
+ sys.exit(1)
474
+ except Exception as e:
475
+ print(f"Error: Failed to start CLI: {e}")
459
476
  sys.exit(1)
477
+
478
+ if last_import_error:
479
+ print(f"Error: Could not load cli.py: {last_import_error}")
480
+ else:
481
+ print("Error: cli.py not found.")
482
+ sys.exit(1)
460
483
  case "serve":
461
484
  open_cxb = False
462
485
  if "--open-cxb" in sys.argv:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.40
3
+ Version: 1.4.40.post2
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -25,6 +25,9 @@ Requires-Dist: jinja2
25
25
  Requires-Dist: pytest-cov
26
26
  Requires-Dist: argon2-cffi
27
27
  Requires-Dist: orjson
28
+ Requires-Dist: prompt_toolkit
29
+ Requires-Dist: rich
30
+ Requires-Dist: requests
28
31
  Provides-Extra: extra
29
32
  Requires-Dist: jsf; extra == "extra"
30
33
  Requires-Dist: types-psutil; extra == "extra"
@@ -44,13 +47,9 @@ Requires-Dist: firebase-admin; extra == "plugins"
44
47
  Requires-Dist: pillow; extra == "plugins"
45
48
  Requires-Dist: ldap3; extra == "plugins"
46
49
  Provides-Extra: cli-requires
47
- Requires-Dist: weasyprint; extra == "cli-requires"
48
- Requires-Dist: pypdf; extra == "cli-requires"
49
- Requires-Dist: dicttoxml; extra == "cli-requires"
50
- Requires-Dist: pdf2image; extra == "cli-requires"
51
- Requires-Dist: firebase-admin; extra == "cli-requires"
52
- Requires-Dist: pillow; extra == "cli-requires"
53
- Requires-Dist: ldap3; extra == "cli-requires"
50
+ Requires-Dist: prompt_toolkit; extra == "cli-requires"
51
+ Requires-Dist: rich; extra == "cli-requires"
52
+ Requires-Dist: requests; extra == "cli-requires"
54
53
  Provides-Extra: all
55
54
  Requires-Dist: jsf; extra == "all"
56
55
  Requires-Dist: types-psutil; extra == "all"
@@ -69,6 +68,8 @@ Requires-Dist: firebase-admin; extra == "all"
69
68
  Requires-Dist: pillow; extra == "all"
70
69
  Requires-Dist: ldap3; extra == "all"
71
70
  Requires-Dist: prompt_toolkit; extra == "all"
71
+ Requires-Dist: rich; extra == "all"
72
+ Requires-Dist: requests; extra == "all"
72
73
  Dynamic: provides-extra
73
74
  Dynamic: requires-dist
74
75
  Dynamic: requires-python
@@ -1,13 +1,13 @@
1
1
  dmart/__init__.py,sha256=xHodcATn-JYaoi3_TVDimR_UWG_ux9uLePUNQDzHhsY,122
2
2
  dmart/alembic.ini,sha256=wQweByyHQm-EI8BQkE0SHNRjULJ6Xn5jqgvv88IT5Sg,3738
3
3
  dmart/bundler.py,sha256=so8ZJResb1PcOH5vboa_mpFAdYr_T8u8DbbFXd570Lg,1704
4
- dmart/cli.py,sha256=aE3_2uHcEiQJA_f6viGRwUmGPB-OaNfzSgDgLR5gf40,40447
4
+ dmart/cli.py,sha256=CyqFdS2O32mrOctsC_wCusCSfN9PSmIIVmfc0tqZrrQ,41618
5
5
  dmart/config.env.sample,sha256=CKd4KIBeUatoFcO2IefmrVNBohpaVMQMFcoPkNBvCeI,696
6
6
  dmart/config.ini.sample,sha256=AADMdwG07zRV_cAGMoOorHQaqzTTL2WEIC_mPWjIslE,159
7
7
  dmart/conftest.py,sha256=0ry_zeCmdBNLbm5q115b-pkOrUFYxdsOUXbIMkr7E5Y,362
8
8
  dmart/curl.sh,sha256=lmHSFVr5ft-lc5Aq9LfvKyWfntrfYbnirhzx1EGjp_A,15743
9
9
  dmart/data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
10
- dmart/dmart.py,sha256=KR4FYOc5yqIkK2oR3F4NuINE4kju8wsEjSRcEiSkwp8,24182
10
+ dmart/dmart.py,sha256=wXuqCpuNRHva4yW43J7lgxn02vtvA_s8v-hyFRvoohk,25060
11
11
  dmart/get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
12
12
  dmart/hypercorn_config.toml,sha256=-eryppEG8HBOM_KbFc4dTQePnpyfoW9ZG5aUATU_6yM,50
13
13
  dmart/info.json,sha256=5Yz4tc5dEt5eVrM2LzLhXgN8vGvE0aDbbbEEaGDsD5k,123
@@ -280,8 +280,8 @@ dmart/utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGV
280
280
  dmart/utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
281
281
  dmart/utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
282
282
  dmart/utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
283
- dmart-1.4.40.dist-info/METADATA,sha256=y57VLJSX2_m7tL7bd_1IqrRHk9AWro9WgG17tfNM_jU,2571
284
- dmart-1.4.40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
285
- dmart-1.4.40.dist-info/entry_points.txt,sha256=N832M4wG8d2GDw1xztKRVM3TnxpY2QDzvdFE8XaWaG8,43
286
- dmart-1.4.40.dist-info/top_level.txt,sha256=zJo4qk9fUW0BGIR9f4DCfpxaXbvQXH9izIOom6JsyAo,6
287
- dmart-1.4.40.dist-info/RECORD,,
283
+ dmart-1.4.40.post2.dist-info/METADATA,sha256=TiJ0jZmWQd7mMxk2wlQyX_2WD9YELXMHyFA_Jb4OFOw,2531
284
+ dmart-1.4.40.post2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
285
+ dmart-1.4.40.post2.dist-info/entry_points.txt,sha256=N832M4wG8d2GDw1xztKRVM3TnxpY2QDzvdFE8XaWaG8,43
286
+ dmart-1.4.40.post2.dist-info/top_level.txt,sha256=zJo4qk9fUW0BGIR9f4DCfpxaXbvQXH9izIOom6JsyAo,6
287
+ dmart-1.4.40.post2.dist-info/RECORD,,