lfss 0.12.1__py3-none-any.whl → 0.12.2__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.
Readme.md CHANGED
@@ -16,7 +16,7 @@ Tested on 2 million files, and it is still fast.
16
16
 
17
17
  Usage:
18
18
  ```sh
19
- pip install lfss
19
+ pip install "lfss[all]"
20
20
  lfss-user add <username> <password>
21
21
  lfss-serve
22
22
  ```
docs/Client.md CHANGED
@@ -3,8 +3,7 @@
3
3
 
4
4
  To install python CLI tools without dependencies (to avoid conflicts with your existing packages):
5
5
  ```sh
6
- pip install requests
7
- pip install lfss --no-deps
6
+ pip install lfss
8
7
  ```
9
8
 
10
9
  Then set the `LFSS_ENDPOINT`, `LFSS_TOKEN` environment variables,
docs/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## 0.12
2
2
 
3
+ ### 0.12.2
4
+ - Setup optional dependencies
5
+ - Present only the name by default for CLI list command
6
+
3
7
  ### 0.12.1
4
8
  - Add `cat` command
5
9
  - Use unicode icons for CLI list command
lfss/cli/cli.py CHANGED
@@ -55,14 +55,18 @@ def print_path_list(
55
55
  print("[F]", end=" ")
56
56
  case _:
57
57
  print("[?]", end=" ")
58
- print(decode_uri_components(r.url), end="")
59
- if detailed:
60
- if isinstance(r, FileRecord):
61
- print(f" | {fmt_storage_size(r.file_size)}, permission={r.permission.name}, created={r.create_time}, accessed={r.access_time}")
58
+ # if not detailed, only print name
59
+ if not detailed:
60
+ if isinstance(r, DirectoryRecord):
61
+ assert r.url.endswith("/")
62
+ print(decode_uri_components(r.url).rstrip("/").split("/")[-1], end="/")
62
63
  else:
63
- print()
64
+ print(decode_uri_components(r.url).split("/")[-1], end="")
64
65
  else:
65
- print()
66
+ print(decode_uri_components(r.url), end="")
67
+ if isinstance(r, FileRecord):
68
+ print(f" :: {fmt_storage_size(r.file_size)} {r.permission.name}", end="")
69
+ print()
66
70
 
67
71
  for d in line_sep(dirs, end=False):
68
72
  print_ln(d)
@@ -117,7 +121,7 @@ def parse_arguments():
117
121
  sp_list.add_argument("path", help="Path to list", type=str)
118
122
  sp_list.add_argument("--offset", type=int, default=0, help="Offset of the list")
119
123
  sp_list.add_argument("--limit", type=int, default=100, help="Limit of the list")
120
- sp_list.add_argument("-l", "--long", action="store_true", help="Detailed list, including all metadata")
124
+ sp_list.add_argument("-l", "--long", action="store_true", help="Detailed list")
121
125
  sp_list.add_argument("--order", "--order-by", type=str, help="Order of the list", default="", choices=typing.get_args(FileSortKey))
122
126
  sp_list.add_argument("--reverse", "--order-desc", action="store_true", help="Reverse the list order")
123
127
 
@@ -126,7 +130,7 @@ def parse_arguments():
126
130
  sp_list_d.add_argument("path", help="Path to list", type=str)
127
131
  sp_list_d.add_argument("--offset", type=int, default=0, help="Offset of the list")
128
132
  sp_list_d.add_argument("--limit", type=int, default=100, help="Limit of the list")
129
- sp_list_d.add_argument("-l", "--long", action="store_true", help="Detailed list, including all metadata")
133
+ sp_list_d.add_argument("-l", "--long", action="store_true", help="Detailed list")
130
134
  sp_list_d.add_argument("--order", "--order-by", type=str, help="Order of the list", default="", choices=typing.get_args(DirSortKey))
131
135
  sp_list_d.add_argument("--reverse", "--order-desc", action="store_true", help="Reverse the list order")
132
136
 
@@ -136,7 +140,7 @@ def parse_arguments():
136
140
  sp_list_f.add_argument("--offset", type=int, default=0, help="Offset of the list")
137
141
  sp_list_f.add_argument("--limit", type=int, default=100, help="Limit of the list")
138
142
  sp_list_f.add_argument("-r", "--recursive", "--flat", action="store_true", help="List files recursively")
139
- sp_list_f.add_argument("-l", "--long", action="store_true", help="Detailed list, including all metadata")
143
+ sp_list_f.add_argument("-l", "--long", action="store_true", help="Detailed list")
140
144
  sp_list_f.add_argument("--order", "--order-by", type=str, help="Order of the list", default="", choices=typing.get_args(FileSortKey))
141
145
  sp_list_f.add_argument("--reverse", "--order-desc", action="store_true", help="Reverse the list order")
142
146
 
lfss/eng/utils.py CHANGED
@@ -3,7 +3,6 @@ import urllib.parse
3
3
  import pathlib
4
4
  import functools
5
5
  import hashlib
6
- import aiofiles
7
6
  import asyncio
8
7
  from asyncio import Lock
9
8
  from collections import OrderedDict
@@ -11,6 +10,11 @@ from concurrent.futures import ThreadPoolExecutor
11
10
  from typing import TypeVar, Callable, Awaitable
12
11
  from functools import wraps, partial
13
12
  from uuid import uuid4
13
+ try:
14
+ # optional dependency for client-side
15
+ import aiofiles
16
+ except ImportError:
17
+ pass
14
18
 
15
19
  async def copy_file(source: str|pathlib.Path, destination: str|pathlib.Path):
16
20
  async with aiofiles.open(source, mode='rb') as src:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lfss
3
- Version: 0.12.1
3
+ Version: 0.12.2
4
4
  Summary: Lite file storage service
5
5
  Home-page: https://github.com/MenxLi/lfss
6
6
  Author: Li, Mengxun
@@ -10,16 +10,15 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: aiofiles (==24.*)
14
- Requires-Dist: aiosqlite (==0.*)
15
- Requires-Dist: fastapi (==0.*)
16
- Requires-Dist: mimesniff (==1.*)
17
- Requires-Dist: pillow
18
- Requires-Dist: python-multipart
13
+ Provides-Extra: all
14
+ Requires-Dist: aiofiles (==24.*) ; extra == "all"
15
+ Requires-Dist: aiosqlite (==0.*) ; extra == "all"
16
+ Requires-Dist: fastapi[standard] (==0.*) ; extra == "all"
17
+ Requires-Dist: mimesniff (==1.*) ; extra == "all"
18
+ Requires-Dist: pillow ; extra == "all"
19
19
  Requires-Dist: requests (==2.*)
20
- Requires-Dist: rich
21
- Requires-Dist: stream-zip (==0.*)
22
- Requires-Dist: uvicorn (==0.*)
20
+ Requires-Dist: rich ; extra == "all"
21
+ Requires-Dist: stream-zip (==0.*) ; extra == "all"
23
22
  Project-URL: Repository, https://github.com/MenxLi/lfss
24
23
  Description-Content-Type: text/markdown
25
24
 
@@ -41,7 +40,7 @@ Tested on 2 million files, and it is still fast.
41
40
 
42
41
  Usage:
43
42
  ```sh
44
- pip install lfss
43
+ pip install "lfss[all]"
45
44
  lfss-user add <username> <password>
46
45
  lfss-serve
47
46
  ```
@@ -1,10 +1,10 @@
1
- Readme.md,sha256=B-foESzFWoSI5MEd89AWUzKcVRrTwipM28TK8GN0o8c,1920
2
- docs/Client.md,sha256=hoF_LrMiGJelEwNIO06aidhEVc0AphaeK-iA-6lxvrU,891
1
+ Readme.md,sha256=1HRivj2C8TV_64XvIjjlM_a5qMSuzDygl40pXwcvIao,1927
2
+ docs/Client.md,sha256=qjsRiZat3hmQ-w7U0JrPKsPiuX2OgijL-6NzufgwVtM,860
3
3
  docs/Enviroment_variables.md,sha256=CZ5DrrXSLU5RLBEVQ-gLMaOIuFthd7dEiTzO7ODrPRQ,788
4
4
  docs/Known_issues.md,sha256=ZqETcWP8lzTOel9b2mxEgCnADFF8IxOrEtiVO1NoMAk,251
5
5
  docs/Permission.md,sha256=thUJx7YRoU63Pb-eqo5l5450DrZN3QYZ36GCn8r66no,3152
6
6
  docs/Webdav.md,sha256=-Ja-BTWSY1BEMAyZycvEMNnkNTPZ49gSPzmf3Lbib70,1547
7
- docs/changelog.md,sha256=yusNvAGnSZCBGSYsWKLyYENw6rgqCtN83FBgSeY0Ax8,2536
7
+ docs/changelog.md,sha256=bl1MMXooqR-_VxMBHVfzR23HPdBY_2UBnM-eop6fTFk,2634
8
8
  frontend/api.js,sha256=RqvwRWhYZx7_cDlyYgWzgJAr83RxH47WzY-5KL6aRX0,22670
9
9
  frontend/index.html,sha256=-k0bJ5FRqdl_H-O441D_H9E-iejgRCaL_z5UeYaS2qc,3384
10
10
  frontend/info.css,sha256=Ny0N3GywQ3a9q1_Qph_QFEKB4fEnTe_2DJ1Y5OsLLmQ,595
@@ -23,7 +23,7 @@ lfss/api/__init__.py,sha256=qHlQAnvw2y0FNZKhes6ikzItEEQvyJWFhVMs1GAqZiM,6822
23
23
  lfss/api/connector.py,sha256=jMgYhSYQN0yDD9B1e35F7x6ZFswR3zBKQ19TkdP2KK0,17018
24
24
  lfss/cli/__init__.py,sha256=OPJLYHvqsyNUoPRzW4ITKQ3hEuotx7u-OsN4Uoz1XvA,1132
25
25
  lfss/cli/balance.py,sha256=fUbKKAUyaDn74f7mmxMfBL4Q4voyBLHu6Lg_g8GfMOQ,4121
26
- lfss/cli/cli.py,sha256=FK8XZZnHxvw8AhnPkQXWc-hwnj4Kxt4N5CQZUrVF5Fw,15019
26
+ lfss/cli/cli.py,sha256=9N8Ar9DfgAvDtIpMcJ2tC6K62WNUpi6mEqU8CbcePjA,15169
27
27
  lfss/cli/cli_lib.py,sha256=QtXB8WsThz4R5n8ZpxKF_20L1BPBpvbC1QJBeuq0-NA,2866
28
28
  lfss/cli/log.py,sha256=TBlt8mhHMouv8ZBUMHYfGZiV6-0yPdajJQ5mkGHEojI,3016
29
29
  lfss/cli/panel.py,sha256=Xq3I_n-ctveym-Gh9LaUpzHiLlvt3a_nuDiwUS-MGrg,1597
@@ -39,7 +39,7 @@ lfss/eng/datatype.py,sha256=27UB7-l9SICy5lAvKjdzpTL_GohZjzstQcr9PtAq7nM,2709
39
39
  lfss/eng/error.py,sha256=JGf5NV-f4rL6tNIDSAx5-l9MG8dEj7F2w_MuOjj1d1o,732
40
40
  lfss/eng/log.py,sha256=yciFQ7Utz1AItNekS4YtdP6bM7i1krA6qSAU2wVQv24,7698
41
41
  lfss/eng/thumb.py,sha256=AFyWEkkpuCKGWOB9bLlaDwPKzQ9JtCSSmHMhX2Gu3CI,3096
42
- lfss/eng/utils.py,sha256=SlgiC5S0V42n9JczFF04jl5tKC7R6gN-FkuqqNoF7co,6688
42
+ lfss/eng/utils.py,sha256=LB84nX-fEgMlWMPo5ByU48U7RCy8EcxqIHAMWP8d-8w,6773
43
43
  lfss/sql/init.sql,sha256=FBmVzkNjYUnWjEELRFzf7xb50GngmzmeDVffT1Uk8u8,1625
44
44
  lfss/sql/pragma.sql,sha256=uENx7xXjARmro-A3XAK8OM8v5AxDMdCCRj47f86UuXg,206
45
45
  lfss/svc/app.py,sha256=r1KUO3sPaaJWbkJF0bcVTD7arPKLs2jFlq52Ixicomo,220
@@ -48,7 +48,7 @@ lfss/svc/app_dav.py,sha256=DRMgByUAQ3gD6wL9xmikV5kvVmATN7QkxGSttFTYxFU,18245
48
48
  lfss/svc/app_native.py,sha256=imqnuAoseTS2CmztUI0yQ0Jjq_jqbjxYG-_FFnYp6u0,11040
49
49
  lfss/svc/common_impl.py,sha256=wlTQm8zEGAfyw9FJvK9zqgLQw47MzNq6IT3OgwdUaCw,13736
50
50
  lfss/svc/request_log.py,sha256=v8yXEIzPjaksu76Oh5vgdbUEUrw8Kt4etLAXBWSGie8,3207
51
- lfss-0.12.1.dist-info/METADATA,sha256=AMMYCFIaaEcI51q1QuFyL3DGJ6TjnbnBmdpWYd_bgNI,2725
52
- lfss-0.12.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
53
- lfss-0.12.1.dist-info/entry_points.txt,sha256=M4ubn9oLYcTc9wxlLKWwljnluStPWpCDlCGuTVU8twg,255
54
- lfss-0.12.1.dist-info/RECORD,,
51
+ lfss-0.12.2.dist-info/METADATA,sha256=8SehEBbT6HyYdWWswTdfsoAtuMp1QNib7mkmrg8t0To,2818
52
+ lfss-0.12.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
53
+ lfss-0.12.2.dist-info/entry_points.txt,sha256=M4ubn9oLYcTc9wxlLKWwljnluStPWpCDlCGuTVU8twg,255
54
+ lfss-0.12.2.dist-info/RECORD,,
File without changes