CTKFileDialog-plus 0.6.0__tar.gz → 2.0.0__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.

Potentially problematic release.


This version of CTKFileDialog-plus might be problematic. Click here for more details.

Files changed (57) hide show
  1. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTKFileDialog_plus.egg-info/PKG-INFO +186 -17
  2. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTKFileDialog_plus.egg-info/SOURCES.txt +18 -1
  3. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/Constants/__init__.py +1 -1
  4. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/Constants/constants.py +1 -1
  5. ctkfiledialog_plus-2.0.0/CTkFileDialog/Dialog.py +25 -0
  6. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/__init__.py +10 -1
  7. ctkfiledialog_plus-2.0.0/CTkFileDialog/_functions.py +521 -0
  8. ctkfiledialog_plus-2.0.0/CTkFileDialog/_system.py +5 -0
  9. ctkfiledialog_plus-2.0.0/CTkFileDialog/core/__init__.py +13 -0
  10. ctkfiledialog_plus-2.0.0/CTkFileDialog/core/filesystem.py +97 -0
  11. ctkfiledialog_plus-2.0.0/CTkFileDialog/core/search.py +13 -0
  12. ctkfiledialog_plus-2.0.0/CTkFileDialog/core/sorting.py +41 -0
  13. ctkfiledialog_plus-2.0.0/CTkFileDialog/preview/__init__.py +4 -0
  14. ctkfiledialog_plus-2.0.0/CTkFileDialog/preview/media.py +126 -0
  15. ctkfiledialog_plus-2.0.0/CTkFileDialog/resources/__init__.py +14 -0
  16. ctkfiledialog_plus-2.0.0/CTkFileDialog/resources/icons.py +89 -0
  17. ctkfiledialog_plus-2.0.0/CTkFileDialog/system/__init__.py +4 -0
  18. ctkfiledialog_plus-0.6.0/CTkFileDialog/_system.py → ctkfiledialog_plus-2.0.0/CTkFileDialog/system/platform.py +26 -8
  19. ctkfiledialog_plus-2.0.0/CTkFileDialog/ui/__init__.py +5 -0
  20. ctkfiledialog_plus-2.0.0/CTkFileDialog/ui/default_dialog.py +1013 -0
  21. ctkfiledialog_plus-2.0.0/CTkFileDialog/ui/mini_dialog.py +454 -0
  22. ctkfiledialog_plus-2.0.0/CTkFileDialog/ui/tooltip.py +25 -0
  23. ctkfiledialog_plus-2.0.0/CTkFileDialog/utils/__init__.py +9 -0
  24. ctkfiledialog_plus-2.0.0/CTkFileDialog/utils/helpers.py +61 -0
  25. ctkfiledialog_plus-2.0.0/LICENSE +21 -0
  26. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/PKG-INFO +186 -17
  27. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/README.md +183 -16
  28. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/pyproject.toml +1 -1
  29. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/setup.py +1 -1
  30. ctkfiledialog_plus-0.6.0/CTkFileDialog/Dialog.py +0 -1426
  31. ctkfiledialog_plus-0.6.0/CTkFileDialog/_functions.py +0 -430
  32. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTKFileDialog_plus.egg-info/dependency_links.txt +0 -0
  33. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTKFileDialog_plus.egg-info/requires.txt +0 -0
  34. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTKFileDialog_plus.egg-info/top_level.txt +0 -0
  35. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/_IconsMini/file.png +0 -0
  36. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/_IconsMini/folder.png +0 -0
  37. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/bash.png +0 -0
  38. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/conf.png +0 -0
  39. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/css.png +0 -0
  40. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/exe.png +0 -0
  41. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/folder.png +0 -0
  42. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/gz.png +0 -0
  43. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/html.png +0 -0
  44. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/image.png +0 -0
  45. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/ini.png +0 -0
  46. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/javascript.png +0 -0
  47. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/js.png +0 -0
  48. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/json.png +0 -0
  49. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/markdown.png +0 -0
  50. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/odt.png +0 -0
  51. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/pdf.png +0 -0
  52. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/php.png +0 -0
  53. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/python.png +0 -0
  54. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/text.png +0 -0
  55. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/CTkFileDialog/icons/video.png +0 -0
  56. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/MANIFEST.in +0 -0
  57. {ctkfiledialog_plus-0.6.0 → ctkfiledialog_plus-2.0.0}/setup.cfg +0 -0
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CTKFileDialog-plus
3
- Version: 0.6.0
3
+ Version: 2.0.0
4
4
  Summary: A modern file dialog for CustomTkinter
5
5
  Home-page: https://github.com/hmidani-abdelilah/CTkFileDialog-plus
6
6
  Author: abdelilah
7
7
  Requires-Python: >=3.7
8
8
  Description-Content-Type: text/markdown
9
+ License-File: LICENSE
9
10
  Requires-Dist: customtkinter
10
11
  Requires-Dist: Pillow
11
12
  Requires-Dist: opencv-python
@@ -13,6 +14,7 @@ Requires-Dist: CTkMessagebox
13
14
  Requires-Dist: CTkToolTip
14
15
  Requires-Dist: typeguard
15
16
  Dynamic: home-page
17
+ Dynamic: license-file
16
18
  Dynamic: requires-python
17
19
 
18
20
  <h1 align="center">CTkFileDialog</h1>
@@ -31,8 +33,10 @@ Dynamic: requires-python
31
33
  - � Search/filter files in real-time
32
34
  - 🖼️ Live image preview
33
35
  - 🎥 Video thumbnail preview
34
- - 📁 Directory selection
35
- - 💾 Save file dialog (return path or open file)
36
+ - 📁 Directory selection (single or multiple)
37
+ - 📄📁 Combined file-or-folder selection (single or multiple)
38
+ - ➕ Create new folders from within the dialog (`foldercreation`)
39
+ - 💾 Save file dialog (return path or open file), with automatic extension (`defaultext`)
36
40
  - ❔ Tooltip support
37
41
  - 🖥️ Shell Path Syntax Support
38
42
  - ⌨️ Backspace using Alt + Left Arrow shortcut
@@ -45,25 +49,23 @@ Dynamic: requires-python
45
49
  ## 📦 Installation
46
50
 
47
51
  ```bash
48
-
49
- # Using bash
52
+ # Using bash
50
53
  git clone https://github.com/hmidani-abdelilah/CTkFileDialog-plus
51
54
  cd CTkFileDialog-plus
52
55
  python3 -m venv .venv
53
56
  source .venv/bin/activate
54
57
  pip3 install -r requirements.txt
55
58
 
56
- # On Windows
57
- git clone https://github.com/hmidani-abdelilah/CTkFileDialog-plus
59
+ # On Windows
60
+ git clone https://github.com/hmidani-abdelilah/CTkFileDialog-plus
58
61
  cd CTkFileDialog-plus
59
- python3 -m venv .venv
60
- .\.venv\Scripts\activate.ps1 # In Powershell
61
- pip3 install -r requirements.txt
62
-
63
- # Or ussing pip
62
+ python3 -m venv .venv
63
+ .\.venv\Scripts\activate.ps1 # In PowerShell
64
+ pip3 install -r requirements.txt
64
65
 
65
- python3 -m venv .venv
66
- source .venv/bin/activate # In powershell -> .\.venv\Scripts\activate.ps1
66
+ # Or using pip
67
+ python3 -m venv .venv
68
+ source .venv/bin/activate # On PowerShell use .\.venv\Scripts\activate.ps1
67
69
  pip3 install CTkFileDialog-plus
68
70
 
69
71
  ```
@@ -73,6 +75,57 @@ pip3 install CTkFileDialog-plus
73
75
 
74
76
  ---
75
77
 
78
+ ## 📁 Project structure
79
+
80
+ ```text
81
+ CTkFileDialog-plus/
82
+ ├── LICENSE # project license terms
83
+ ├── README.md # user and developer documentation
84
+ ├── requirements.txt # Python dependencies
85
+ ├── test.py # general package usage example
86
+ ├── test_save_as.py # save-as dialog regression/test example
87
+ ├── CTkFileDialog/ # package source code
88
+ │ ├── __init__.py # public package API
89
+ │ ├── _functions.py # dialog helper functions exposed to users
90
+ │ ├── _system.py # cross-platform path handling support
91
+ │ ├── Dialog.py # dialog imports and public component exports
92
+ │ ├── Constants/ # reusable package constants
93
+ │ │ ├── __init__.py
94
+ │ │ └── constants.py
95
+ │ ├── core/ # core filesystem/search/sorting logic
96
+ │ │ ├── __init__.py
97
+ │ │ ├── filesystem.py
98
+ │ │ ├── search.py
99
+ │ │ └── sorting.py
100
+ │ ├── icons/ # icon assets for the dialogs
101
+ │ │ ├── _IconsMini/
102
+ │ │ └── *.png
103
+ │ ├── preview/ # image/video preview helpers
104
+ │ │ ├── __init__.py
105
+ │ │ └── media.py
106
+ │ ├── resources/ # shared resource loading utilities
107
+ │ │ ├── __init__.py
108
+ │ │ └── icons.py
109
+ │ ├── system/ # platform-specific system utilities
110
+ │ │ ├── __init__.py
111
+ │ │ └── platform.py
112
+ │ ├── ui/ # dialog UI implementations and widgets
113
+ │ │ ├── __init__.py
114
+ │ │ ├── default_dialog.py
115
+ │ │ ├── mini_dialog.py
116
+ │ │ └── tooltip.py
117
+ │ └── utils/ # small helper utilities
118
+ │ ├── __init__.py
119
+ │ └── helpers.py
120
+ ├── Images/ # README screenshots showing light and dark themes
121
+ │ ├── MiniDialogDark.png
122
+ │ ├── MiniDialogLight.png
123
+ │ ├── NormalDialogDark.png
124
+ │ └── NormalDialogLight.png
125
+ ```
126
+
127
+ ---
128
+
76
129
  ## 🧪 Demo — All Methods
77
130
 
78
131
  ### 🗂️ Open File
@@ -171,7 +224,113 @@ app.mainloop()
171
224
 
172
225
  ---
173
226
 
174
- ### 💾 Save As (get path only)
227
+ ### 📁 Select Single Directory (askopendirname)
228
+
229
+ ```python
230
+ import customtkinter as ctk
231
+ from CTkFileDialog import askopendirname
232
+
233
+ ctk.set_appearance_mode("Dark")
234
+ ctk.set_default_color_theme("blue")
235
+
236
+ def select_directory():
237
+ folder = askopendirname(autocomplete=True)
238
+ if folder:
239
+ result_label.configure(text=f"Selected directory:\n{folder}")
240
+
241
+ app = ctk.CTk()
242
+ app.title("askopendirname Demo")
243
+ app.geometry("500x200")
244
+
245
+ ctk.CTkButton(app, text="Select Directory", command=select_directory).pack(pady=20)
246
+ result_label = ctk.CTkLabel(app, text="Waiting for directory selection...")
247
+ result_label.pack()
248
+
249
+ app.mainloop()
250
+ ```
251
+
252
+ ---
253
+
254
+ ### 📁 Select Multiple Directories (askopendirnames)
255
+
256
+ ```python
257
+ import customtkinter as ctk
258
+ from CTkFileDialog import askopendirnames
259
+
260
+ ctk.set_appearance_mode("Dark")
261
+ ctk.set_default_color_theme("blue")
262
+
263
+ def select_directories():
264
+ # Hold Ctrl or Shift while clicking to select several folders
265
+ folders = askopendirnames(autocomplete=True)
266
+ if folders:
267
+ result_label.configure(text="Selected directories:\n" + "\n".join(folders))
268
+
269
+ app = ctk.CTk()
270
+ app.title("askopendirnames Demo")
271
+ app.geometry("500x300")
272
+
273
+ ctk.CTkButton(app, text="Select Directories", command=select_directories).pack(pady=20)
274
+ result_label = ctk.CTkLabel(app, text="Waiting for directory selection...", wraplength=450)
275
+ result_label.pack()
276
+
277
+ app.mainloop()
278
+ ```
279
+
280
+ ---
281
+
282
+ ### 📄📁 Select a File or a Folder (askopenpathname)
283
+
284
+ ```python
285
+ import customtkinter as ctk
286
+ from CTkFileDialog import askopenpathname
287
+
288
+ ctk.set_appearance_mode("Dark")
289
+ ctk.set_default_color_theme("blue")
290
+
291
+ def select_path():
292
+ path = askopenpathname(autocomplete=True)
293
+ if path:
294
+ result_label.configure(text=f"Selected:\n{path}")
295
+
296
+ app = ctk.CTk()
297
+ app.title("askopenpathname Demo")
298
+ app.geometry("500x200")
299
+
300
+ ctk.CTkButton(app, text="Select File or Folder", command=select_path).pack(pady=20)
301
+ result_label = ctk.CTkLabel(app, text="Waiting for selection...")
302
+ result_label.pack()
303
+
304
+ app.mainloop()
305
+ ```
306
+
307
+ ---
308
+
309
+ ### 📄📁 Select Multiple Files and/or Folders (askopenpathnames)
310
+
311
+ ```python
312
+ import customtkinter as ctk
313
+ from CTkFileDialog import askopenpathnames
314
+
315
+ ctk.set_appearance_mode("Dark")
316
+ ctk.set_default_color_theme("blue")
317
+
318
+ def select_paths():
319
+ # Hold Ctrl or Shift while clicking to mix files and folders in one selection
320
+ items = askopenpathnames(autocomplete=True)
321
+ if items:
322
+ result_label.configure(text="Selected:\n" + "\n".join(items))
323
+
324
+ app = ctk.CTk()
325
+ app.title("askopenpathnames Demo")
326
+ app.geometry("500x300")
327
+
328
+ ctk.CTkButton(app, text="Select Files/Folders", command=select_paths).pack(pady=20)
329
+ result_label = ctk.CTkLabel(app, text="Waiting for selection...", wraplength=450)
330
+ result_label.pack()
331
+
332
+ app.mainloop()
333
+ ```
175
334
 
176
335
  ```python
177
336
  import customtkinter as ctk
@@ -185,6 +344,9 @@ def save_as_filename():
185
344
  if path:
186
345
  result_label.configure(text=f"Save file as:\n{path}")
187
346
 
347
+ # You can also auto-append an extension if the user doesn't type one:
348
+ # path = asksaveasfilename(autocomplete=True, defaultext=".txt")
349
+
188
350
  app = ctk.CTk()
189
351
  app.title("asksaveasfilename Demo")
190
352
  app.geometry("500x200")
@@ -214,6 +376,11 @@ def save_as_file():
214
376
  file.close()
215
377
  result_label.configure(text=f"File saved:\n{file.name}")
216
378
 
379
+ # Alternatively, asksaveasfile supports the context manager protocol:
380
+ # with asksaveasfile(autocomplete=True) as file:
381
+ # if file:
382
+ # file.write("This file was created using the demo.")
383
+
217
384
  app = ctk.CTk()
218
385
  app.title("asksaveasfile Demo")
219
386
  app.geometry("500x200")
@@ -301,9 +468,11 @@ app.mainloop()
301
468
  | `autocomplete` | Enable path autocompletion with `Tab`, `Up`, and `Down`. |
302
469
  | `initial_dir` | Set the initial directory when opening the dialog. |
303
470
  | `tool_tip` | Enable the tool tip. |
471
+ | `foldercreation`| Enable a "New Folder" button so the user can create folders from within the dialog (`True` by default). |
472
+ | `defaultext` | *(`asksaveasfilename`/`asksaveasfile` only)* Extension appended to the filename if the user didn't type one (default is none). |
304
473
  | `style` | Defines the dialog style, by default it will be 'Default' but you can choose a small one ('Mini'). |
305
- | `geometry` | You define the geometry string in a tuple: Example ('NormalGM', 'MiniGeometry'). |
306
- | `title` | Define the title from the app, default will be "CTkFileDialog". |
474
+ | `geometry` | Defines the dialog size. For functions that support both styles, pass a tuple `(default_geometry, mini_geometry)`. |
475
+ | `title` | Define the title for the dialog window. Defaults to `CTkFileDialog`. |
307
476
 
308
477
 
309
478
  </div>
@@ -1,3 +1,4 @@
1
+ LICENSE
1
2
  MANIFEST.in
2
3
  README.md
3
4
  pyproject.toml
@@ -13,6 +14,10 @@ CTkFileDialog/_functions.py
13
14
  CTkFileDialog/_system.py
14
15
  CTkFileDialog/Constants/__init__.py
15
16
  CTkFileDialog/Constants/constants.py
17
+ CTkFileDialog/core/__init__.py
18
+ CTkFileDialog/core/filesystem.py
19
+ CTkFileDialog/core/search.py
20
+ CTkFileDialog/core/sorting.py
16
21
  CTkFileDialog/icons/bash.png
17
22
  CTkFileDialog/icons/conf.png
18
23
  CTkFileDialog/icons/css.png
@@ -33,4 +38,16 @@ CTkFileDialog/icons/python.png
33
38
  CTkFileDialog/icons/text.png
34
39
  CTkFileDialog/icons/video.png
35
40
  CTkFileDialog/icons/_IconsMini/file.png
36
- CTkFileDialog/icons/_IconsMini/folder.png
41
+ CTkFileDialog/icons/_IconsMini/folder.png
42
+ CTkFileDialog/preview/__init__.py
43
+ CTkFileDialog/preview/media.py
44
+ CTkFileDialog/resources/__init__.py
45
+ CTkFileDialog/resources/icons.py
46
+ CTkFileDialog/system/__init__.py
47
+ CTkFileDialog/system/platform.py
48
+ CTkFileDialog/ui/__init__.py
49
+ CTkFileDialog/ui/default_dialog.py
50
+ CTkFileDialog/ui/mini_dialog.py
51
+ CTkFileDialog/ui/tooltip.py
52
+ CTkFileDialog/utils/__init__.py
53
+ CTkFileDialog/utils/helpers.py
@@ -42,4 +42,4 @@ __all__ = [
42
42
  'PATHS',
43
43
  'DOWNLOAD_DIR',
44
44
  'DOWNLOAD_DIR_VIDEO',
45
- ]
45
+ ]
@@ -50,4 +50,4 @@ PATHS = {
50
50
  'VENV': VENV,
51
51
  'DOWNLOAD_DIR': DOWNLOAD_DIR,
52
52
  'DOWNLOAD_DIR_VIDEO': DOWNLOAD_DIR_VIDEO
53
- }
53
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env python
2
+ """Backward-compatibility shim.
3
+
4
+ Historically all dialog classes lived in this module. They have been
5
+ moved to ``CTkFileDialog.ui``. This file re-exports the public names so
6
+ any external ``from CTkFileDialog.Dialog import _DrawApp`` continues to
7
+ work.
8
+ """
9
+ from .ui.default_dialog import DrawApp, _DrawApp
10
+ from .ui.mini_dialog import MiniDialog, _MiniDialog
11
+ from .ui.tooltip import CustomToolTip
12
+ from .system.platform import System as _System
13
+
14
+ # Historical private name
15
+ _CustomToolTip = CustomToolTip
16
+
17
+ __all__ = [
18
+ "DrawApp",
19
+ "_DrawApp",
20
+ "MiniDialog",
21
+ "_MiniDialog",
22
+ "CustomToolTip",
23
+ "_CustomToolTip",
24
+ "_System",
25
+ ]
@@ -10,7 +10,12 @@ File dialog created in custom Tkinter and inspired by the Tkinter dialog.
10
10
  - Github: https://github.com/hmidani-abdelilah/CTkFileDialog-plus
11
11
  - License: MIT
12
12
  '''
13
- from ._functions import askopenfilename, askdirectory, askopenfile, askopenfiles, askopenfilenames, asksaveasfile, asksaveasfilename
13
+ from ._functions import (
14
+ askopenfilename, askdirectory, askopenfile, askopenfiles, askopenfilenames,
15
+ asksaveasfile, asksaveasfilename,
16
+ askopendirname, askopendirnames,
17
+ askopenpathname, askopenpathnames,
18
+ )
14
19
  from . import Constants
15
20
 
16
21
  __version__ = '0.3.3'
@@ -22,6 +27,10 @@ __all__ = [
22
27
  'askopenfilenames',
23
28
  'asksaveasfile',
24
29
  'asksaveasfilename',
30
+ 'askopendirname',
31
+ 'askopendirnames',
32
+ 'askopenpathname',
33
+ 'askopenpathnames',
25
34
  'Constants'
26
35
  ]
27
36