gitonic 0.0.14__tar.gz → 0.16.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.
Files changed (31) hide show
  1. {gitonic-0.0.14 → gitonic-0.16.0}/CHANGELOG.md +31 -7
  2. {gitonic-0.0.14 → gitonic-0.16.0}/PKG-INFO +128 -23
  3. {gitonic-0.0.14 → gitonic-0.16.0}/README.md +72 -6
  4. gitonic-0.16.0/gitonic/const.py +1 -0
  5. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/gitutil.py +29 -6
  6. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/gui.py +88 -23
  7. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/main.py +8 -1
  8. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/PKG-INFO +128 -23
  9. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/entry_points.txt +0 -4
  10. {gitonic-0.0.14 → gitonic-0.16.0}/setup.py +4 -0
  11. gitonic-0.0.14/gitonic/const.py +0 -1
  12. {gitonic-0.0.14 → gitonic-0.16.0}/BACKLOG.md +0 -0
  13. {gitonic-0.0.14 → gitonic-0.16.0}/LICENSE.md +0 -0
  14. {gitonic-0.0.14 → gitonic-0.16.0}/MANIFEST.in +0 -0
  15. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/__init__.py +0 -0
  16. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/__main__.py +0 -0
  17. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/file.py +0 -0
  18. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/icons.py +0 -0
  19. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/pyjsoncfg.py +0 -0
  20. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/singleinstance.py +0 -0
  21. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/sysutil.py +0 -0
  22. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/task.py +0 -0
  23. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/tile/__init__.py +0 -0
  24. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/tile/core.py +0 -0
  25. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic/tile/tkcmd.py +0 -0
  26. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/SOURCES.txt +0 -0
  27. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/dependency_links.txt +0 -0
  28. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/requires.txt +8 -8
  29. {gitonic-0.0.14 → gitonic-0.16.0}/gitonic.egg-info/top_level.txt +0 -0
  30. {gitonic-0.0.14 → gitonic-0.16.0}/pyproject.toml +0 -0
  31. {gitonic-0.0.14 → gitonic-0.16.0}/setup.cfg +0 -0
@@ -2,7 +2,31 @@
2
2
  # Changelog
3
3
 
4
4
 
5
- # version v0.0.14 - 20240518
5
+ ## version v0.16.0 - 20250219
6
+
7
+ - support for multiple repo workspaces
8
+ - on `settings` tab the `workspaces` entry field accepts a
9
+ list of paths separated by `;`
10
+ - use `~` for user-home path
11
+ - blanks between `;` separated paths are ignored
12
+ - when using double or single quotes around paths make sure the `;` exists to separate paths
13
+ - blanks at the start or end of paths are not supported
14
+ - added `$PYTHON` to context menu variables
15
+ - added clear message after commit select box
16
+ - added keyboard interrupt cntrl+c handler
17
+ - added `workdir` key for context menu handlers
18
+ - changing versioning scheme in pypi
19
+ -
20
+
21
+
22
+ ## version v0.0.15 - 20240812
23
+
24
+ - fix: blank in path will show file as deleted
25
+ - fix: rename file with git
26
+ -
27
+
28
+
29
+ ## version v0.0.14 - 20240518
6
30
 
7
31
  - improved formatter
8
32
  - support for multiple file extension for single config entry
@@ -19,13 +43,13 @@
19
43
  -
20
44
 
21
45
 
22
- # version v0.0.13 - 20231125
46
+ ## version v0.0.13 - 20231125
23
47
 
24
48
  - show all untracked files on changes tab (not only the folder)
25
49
  -
26
50
 
27
51
 
28
- # version v0.0.12 - 20231111
52
+ ## version v0.0.12 - 20231111
29
53
 
30
54
  - support for more code formatters (included in standard installation as extras)
31
55
  - install with `pip install gitonic[PEP08]`
@@ -40,7 +64,7 @@
40
64
  -
41
65
 
42
66
 
43
- # version v0.0.11 - 20230710
67
+ ## version v0.0.11 - 20230710
44
68
 
45
69
  - fixed logging
46
70
  - fix no branch crash when no branch is set up
@@ -53,20 +77,20 @@
53
77
  -
54
78
 
55
79
 
56
- # version v0.0.10 - 20230225
80
+ ## version v0.0.10 - 20230225
57
81
 
58
82
  - sort files in changes tab
59
83
  -
60
84
 
61
85
 
62
- # version v0.0.9 - 20221008
86
+ ## version v0.0.9 - 20221008
63
87
 
64
88
  - git current branch in changes tab
65
89
  - support for black
66
90
  -
67
91
 
68
92
 
69
- # version v0.0.8 - 20220802
93
+ ## version v0.0.8 - 20220802
70
94
 
71
95
  - bug fix, due to corrupted local env
72
96
  - double click in changes view will stage/ unstage a file
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitonic
3
- Version: 0.0.14
3
+ Version: 0.16.0
4
4
  Summary: manage a multi git workspace
5
5
  Home-page: https://github.com/kr-g/gitonic
6
6
  Author: k. goger
7
7
  Author-email: k.r.goger+gitonic@gmail.com
8
8
  License: AGPLv3+
9
9
  Keywords: python utility shell git git-workspace tkinter
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 3 - Alpha
12
11
  Classifier: Operating System :: POSIX :: Linux
13
12
  Classifier: Environment :: Other Environment
@@ -17,19 +16,37 @@ Classifier: Topic :: Desktop Environment
17
16
  Classifier: Topic :: Software Development :: Version Control :: Git
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
20
- Requires-Python: >=3.10
19
+ Requires-Python: >=3.12
21
20
  Description-Content-Type: text/markdown
22
- Provides-Extra: DEFAULT
23
- Provides-Extra: MELD
24
- Provides-Extra: PEP08
25
- Provides-Extra: PEP08_BLACK
26
- Provides-Extra: PEP08_FULL
27
21
  License-File: LICENSE.md
22
+ Requires-Dist: pytkfaicons
23
+ Requires-Dist: tkinter-tooltip
24
+ Provides-Extra: pep08
25
+ Requires-Dist: pycodestyle; extra == "pep08"
26
+ Requires-Dist: flake8; extra == "pep08"
27
+ Requires-Dist: autopep8; extra == "pep08"
28
+ Provides-Extra: pep08-black
29
+ Requires-Dist: pycodestyle; extra == "pep08-black"
30
+ Requires-Dist: flake8; extra == "pep08-black"
31
+ Requires-Dist: black; extra == "pep08-black"
32
+ Provides-Extra: pep08-full
33
+ Requires-Dist: pycodestyle; extra == "pep08-full"
34
+ Requires-Dist: flake8; extra == "pep08-full"
35
+ Requires-Dist: autopep8; extra == "pep08-full"
36
+ Requires-Dist: black; extra == "pep08-full"
37
+ Requires-Dist: yapf; extra == "pep08-full"
38
+ Provides-Extra: meld
39
+ Requires-Dist: meld; extra == "meld"
40
+ Provides-Extra: default
41
+ Requires-Dist: pycodestyle; extra == "default"
42
+ Requires-Dist: flake8; extra == "default"
43
+ Requires-Dist: autopep8; extra == "default"
44
+ Requires-Dist: meld; extra == "default"
28
45
 
29
46
  [![PEP-08](https://img.shields.io/badge/code%20style-PEP08-green.svg)](https://www.python.org/dev/peps/pep-0008/)
30
47
 
31
48
 
32
- you are reading VERSION = v0.0.14
49
+ you are reading VERSION = v0.16.0
33
50
 
34
51
 
35
52
  # gitonic
@@ -211,8 +228,12 @@ files with extension `.pyx` change the setting to
211
228
 
212
229
  black is also an offical python tool, but resolves not fully to issues reported by pycodestyle.
213
230
  there might be some rework required (from case to case).
214
- result is quite similar to autopep8 beside the list reported by pycodestyle (after formatting)
215
- is a bit longer comparing to autopep8 what does a better job here.
231
+ result is quite similar to
232
+ [autopep8](https://github.com/hhatto/autopep8)
233
+ beside the list reported by pycodestyle (after formatting)
234
+ is a bit longer comparing to
235
+ [autopep8](https://github.com/hhatto/autopep8)
236
+ what does a better job here.
216
237
 
217
238
  {
218
239
  ".py": {
@@ -288,6 +309,7 @@ the general structure is:
288
309
  {
289
310
  "a-context-name-ctx": {
290
311
  "expr": "*",
312
+ "workdir": ".",
291
313
  "menu": [
292
314
  [
293
315
  "some text $GIT",
@@ -309,13 +331,17 @@ the general structure is:
309
331
  }
310
332
 
311
333
 
312
- here the variables `$GIT`, `$PATH`, or `$FILE` are replaced
313
- by the corrosponding path before execution.
334
+ here the variables `$GIT`, `$PATH`, `$FILE`, or `$PYTHON` are replaced
335
+ by the corrosponding path before execution.
336
+ where `$PYTHON` expands to `sys.executable` from `gitonic` runtime.
314
337
 
315
338
  the `expr` key contains a single file pattern, or a list of
316
339
  file patterns - when to enable the context menu.
317
340
  the file pattern is following Unix filename pattern matching.
318
341
 
342
+ the `workdir` key will change the current working directory before running
343
+ the command.
344
+
319
345
  the `menu` array contains the text to display in the menu,
320
346
  and the command params as embedded array.
321
347
 
@@ -365,7 +391,20 @@ for running on linux with xfce.
365
391
  ]
366
392
  ]
367
393
  },
368
- "geany-ctx": {
394
+ "autopep8-ctx": {
395
+ "expr": "*.py",
396
+ "menu": [
397
+ [
398
+ "autopep8 python $FILE",
399
+ [
400
+ "autopep8",
401
+ "-i",
402
+ "$FILE"
403
+ ]
404
+ ]
405
+ ]
406
+ },
407
+ "geany-path": {
369
408
  "expr": [
370
409
  "*.c",
371
410
  "*.cpp",
@@ -380,6 +419,48 @@ for running on linux with xfce.
380
419
  ]
381
420
  ]
382
421
  ]
422
+ },
423
+ "uncrustify-path": {
424
+ "expr": [
425
+ "*.c",
426
+ "*.cpp",
427
+ "*.h"
428
+ ],
429
+ "menu": [
430
+ [
431
+ "uncrustify c $FILE",
432
+ [
433
+ "uncrustify",
434
+ "-c",
435
+ "~/.gitonic/uncrustify.cfg",
436
+ "--replace",
437
+ "$FILE",
438
+ "--no-backup",
439
+ "--if-changed"
440
+ ]
441
+ ]
442
+ ]
443
+ },
444
+ "git-base-tools": {
445
+ "expr": [
446
+ "*"
447
+ ],
448
+ "workdir" : "$GIT",
449
+ "menu": [
450
+ [
451
+ "gitk $GIT",
452
+ [
453
+ "gitk"
454
+ ]
455
+ ],
456
+ [
457
+ "git gui $GIT",
458
+ [
459
+ "git",
460
+ "gui"
461
+ ]
462
+ ]
463
+ ]
383
464
  }
384
465
  }
385
466
 
@@ -390,6 +471,8 @@ the sample config file provides support for opening
390
471
  - `.gitignore` file for selected repo with [`xed`](https://en.wikipedia.org/wiki/Xed)
391
472
  - [`spyder-ide.org`](https://spyder-ide.org/), for files matching `*.py`
392
473
  - [`geany`](https://www.geany.org/), for files matching `*.c`, `*.cpp`, `*.h`
474
+ - `gitk` and `git gui` the base git tools which are automatically installed with `git`
475
+ -
393
476
 
394
477
 
395
478
  **limitation:**
@@ -566,7 +649,31 @@ gitonic is released under the following
566
649
  # Changelog
567
650
 
568
651
 
569
- # version v0.0.14 - 20240518
652
+ ## version v0.16.0 - 20250219
653
+
654
+ - support for multiple repo workspaces
655
+ - on `settings` tab the `workspaces` entry field accepts a
656
+ list of paths separated by `;`
657
+ - use `~` for user-home path
658
+ - blanks between `;` separated paths are ignored
659
+ - when using double or single quotes around paths make sure the `;` exists to separate paths
660
+ - blanks at the start or end of paths are not supported
661
+ - added `$PYTHON` to context menu variables
662
+ - added clear message after commit select box
663
+ - added keyboard interrupt cntrl+c handler
664
+ - added `workdir` key for context menu handlers
665
+ - changing versioning scheme in pypi
666
+ -
667
+
668
+
669
+ ## version v0.0.15 - 20240812
670
+
671
+ - fix: blank in path will show file as deleted
672
+ - fix: rename file with git
673
+ -
674
+
675
+
676
+ ## version v0.0.14 - 20240518
570
677
 
571
678
  - improved formatter
572
679
  - support for multiple file extension for single config entry
@@ -583,13 +690,13 @@ gitonic is released under the following
583
690
  -
584
691
 
585
692
 
586
- # version v0.0.13 - 20231125
693
+ ## version v0.0.13 - 20231125
587
694
 
588
695
  - show all untracked files on changes tab (not only the folder)
589
696
  -
590
697
 
591
698
 
592
- # version v0.0.12 - 20231111
699
+ ## version v0.0.12 - 20231111
593
700
 
594
701
  - support for more code formatters (included in standard installation as extras)
595
702
  - install with `pip install gitonic[PEP08]`
@@ -604,7 +711,7 @@ gitonic is released under the following
604
711
  -
605
712
 
606
713
 
607
- # version v0.0.11 - 20230710
714
+ ## version v0.0.11 - 20230710
608
715
 
609
716
  - fixed logging
610
717
  - fix no branch crash when no branch is set up
@@ -617,20 +724,20 @@ gitonic is released under the following
617
724
  -
618
725
 
619
726
 
620
- # version v0.0.10 - 20230225
727
+ ## version v0.0.10 - 20230225
621
728
 
622
729
  - sort files in changes tab
623
730
  -
624
731
 
625
732
 
626
- # version v0.0.9 - 20221008
733
+ ## version v0.0.9 - 20221008
627
734
 
628
735
  - git current branch in changes tab
629
736
  - support for black
630
737
  -
631
738
 
632
739
 
633
- # version v0.0.8 - 20220802
740
+ ## version v0.0.8 - 20220802
634
741
 
635
742
  - bug fix, due to corrupted local env
636
743
  - double click in changes view will stage/ unstage a file
@@ -1469,5 +1576,3 @@ https://www.gnu.org/licenses/agpl-3.0.de.html
1469
1576
 
1470
1577
 
1471
1578
 
1472
-
1473
-
@@ -1,7 +1,7 @@
1
1
  [![PEP-08](https://img.shields.io/badge/code%20style-PEP08-green.svg)](https://www.python.org/dev/peps/pep-0008/)
2
2
 
3
3
 
4
- you are reading VERSION = v0.0.14
4
+ you are reading VERSION = v0.16.0
5
5
 
6
6
 
7
7
  # gitonic
@@ -183,8 +183,12 @@ files with extension `.pyx` change the setting to
183
183
 
184
184
  black is also an offical python tool, but resolves not fully to issues reported by pycodestyle.
185
185
  there might be some rework required (from case to case).
186
- result is quite similar to autopep8 beside the list reported by pycodestyle (after formatting)
187
- is a bit longer comparing to autopep8 what does a better job here.
186
+ result is quite similar to
187
+ [autopep8](https://github.com/hhatto/autopep8)
188
+ beside the list reported by pycodestyle (after formatting)
189
+ is a bit longer comparing to
190
+ [autopep8](https://github.com/hhatto/autopep8)
191
+ what does a better job here.
188
192
 
189
193
  {
190
194
  ".py": {
@@ -260,6 +264,7 @@ the general structure is:
260
264
  {
261
265
  "a-context-name-ctx": {
262
266
  "expr": "*",
267
+ "workdir": ".",
263
268
  "menu": [
264
269
  [
265
270
  "some text $GIT",
@@ -281,13 +286,17 @@ the general structure is:
281
286
  }
282
287
 
283
288
 
284
- here the variables `$GIT`, `$PATH`, or `$FILE` are replaced
285
- by the corrosponding path before execution.
289
+ here the variables `$GIT`, `$PATH`, `$FILE`, or `$PYTHON` are replaced
290
+ by the corrosponding path before execution.
291
+ where `$PYTHON` expands to `sys.executable` from `gitonic` runtime.
286
292
 
287
293
  the `expr` key contains a single file pattern, or a list of
288
294
  file patterns - when to enable the context menu.
289
295
  the file pattern is following Unix filename pattern matching.
290
296
 
297
+ the `workdir` key will change the current working directory before running
298
+ the command.
299
+
291
300
  the `menu` array contains the text to display in the menu,
292
301
  and the command params as embedded array.
293
302
 
@@ -337,7 +346,20 @@ for running on linux with xfce.
337
346
  ]
338
347
  ]
339
348
  },
340
- "geany-ctx": {
349
+ "autopep8-ctx": {
350
+ "expr": "*.py",
351
+ "menu": [
352
+ [
353
+ "autopep8 python $FILE",
354
+ [
355
+ "autopep8",
356
+ "-i",
357
+ "$FILE"
358
+ ]
359
+ ]
360
+ ]
361
+ },
362
+ "geany-path": {
341
363
  "expr": [
342
364
  "*.c",
343
365
  "*.cpp",
@@ -352,6 +374,48 @@ for running on linux with xfce.
352
374
  ]
353
375
  ]
354
376
  ]
377
+ },
378
+ "uncrustify-path": {
379
+ "expr": [
380
+ "*.c",
381
+ "*.cpp",
382
+ "*.h"
383
+ ],
384
+ "menu": [
385
+ [
386
+ "uncrustify c $FILE",
387
+ [
388
+ "uncrustify",
389
+ "-c",
390
+ "~/.gitonic/uncrustify.cfg",
391
+ "--replace",
392
+ "$FILE",
393
+ "--no-backup",
394
+ "--if-changed"
395
+ ]
396
+ ]
397
+ ]
398
+ },
399
+ "git-base-tools": {
400
+ "expr": [
401
+ "*"
402
+ ],
403
+ "workdir" : "$GIT",
404
+ "menu": [
405
+ [
406
+ "gitk $GIT",
407
+ [
408
+ "gitk"
409
+ ]
410
+ ],
411
+ [
412
+ "git gui $GIT",
413
+ [
414
+ "git",
415
+ "gui"
416
+ ]
417
+ ]
418
+ ]
355
419
  }
356
420
  }
357
421
 
@@ -362,6 +426,8 @@ the sample config file provides support for opening
362
426
  - `.gitignore` file for selected repo with [`xed`](https://en.wikipedia.org/wiki/Xed)
363
427
  - [`spyder-ide.org`](https://spyder-ide.org/), for files matching `*.py`
364
428
  - [`geany`](https://www.geany.org/), for files matching `*.c`, `*.cpp`, `*.h`
429
+ - `gitk` and `git gui` the base git tools which are automatically installed with `git`
430
+ -
365
431
 
366
432
 
367
433
  **limitation:**
@@ -0,0 +1 @@
1
+ VERSION = "v0.16.0"
@@ -184,6 +184,15 @@ class GitStatus(object):
184
184
  def set(self, mode, staged, file):
185
185
  self.mode = mode.upper() if mode else ""
186
186
  self.staged = staged.upper() if staged else ""
187
+
188
+ if self.staged == "R":
189
+ oldname, newname = file.split("->", maxsplit=1)
190
+ file = newname # .strip()
191
+
192
+ if file and file.startswith("\""):
193
+ assert file.endswith("\""), "quoted string expected. " + str(file)
194
+ file = file[1:-1]
195
+
187
196
  self.file = file
188
197
  self.state = {}
189
198
 
@@ -265,19 +274,33 @@ class GitRepo(object):
265
274
 
266
275
  class GitWorkspace(object):
267
276
  def __init__(self, base_repo_dir="~/repo"):
268
- self.base_repo_dir = FileStat(base_repo_dir)
277
+ base_repo_dir = base_repo_dir.split(";")
278
+ base_repo_dir = map(lambda x: x.strip(), base_repo_dir)
279
+ base_repo_dir = map(lambda x: self._strip_quotes(x), base_repo_dir)
280
+ base_repo_dir = map(lambda x: x.strip(), base_repo_dir)
281
+ base_repo_dir = filter(lambda x: len(x) > 0, base_repo_dir)
282
+ base_repo_dir = filter(lambda x: FileStat(x).exists(), base_repo_dir)
283
+
284
+ self.base_repo_dir = [FileStat(x) for x in base_repo_dir]
269
285
  self.gits = {}
270
286
 
271
287
  def __repr__(self):
272
288
  return f"{self.__class__.__name__}( { ', '.join(self.gits) } )"
273
289
 
290
+ def _strip_quotes(self, s):
291
+ for quo in ["\"", "\'"]:
292
+ if s.startswith(quo) and s.endswith(quo):
293
+ return s[1:-1]
294
+ return s
295
+
274
296
  def refresh(self):
275
297
  self.gits.clear()
276
- gits = self.base_repo_dir.iglob("*/.git", True)
277
- for g in gits:
278
- path = g.dirname()
279
- git = GitRepo(path)
280
- self.gits[path] = git
298
+ for repodir in self.base_repo_dir:
299
+ gits = repodir.iglob("*/.git", True)
300
+ for g in gits:
301
+ path = g.dirname()
302
+ git = GitRepo(path)
303
+ self.gits[path] = git
281
304
 
282
305
  def refresh_status(self):
283
306
  for _, git in self.gits.items():
@@ -1,6 +1,9 @@
1
+
2
+
1
3
  from .const import VERSION
2
4
 
3
5
  import os
6
+ import sys
4
7
  import time
5
8
  import json
6
9
  import webbrowser
@@ -14,7 +17,7 @@ from tkinter import Tk
14
17
  from .icons import get_icon
15
18
 
16
19
  from .tile import *
17
- from .file import FileStat
20
+ from .file import FileStat, PushDir
18
21
  from .sysutil import open_file_explorer
19
22
 
20
23
  from .gitutil import set_git_exe, GIT, GitWorkspace, git_diff, git_difftool
@@ -41,6 +44,7 @@ follow = True
41
44
  auto_switch = True
42
45
  push_tags = False
43
46
  show_changes = False
47
+ clear_after_commit = False
44
48
  min_commit_length = 5
45
49
  dev_mode = False
46
50
  dev_follow = True
@@ -102,7 +106,7 @@ def set_config():
102
106
  dgb_pr("set-config", config.__dict__)
103
107
 
104
108
  global frepo
105
- frepo = FileStat(config().workspace)
109
+ frepo = config().workspace
106
110
  global max_history
107
111
  max_history = config().max_history
108
112
  global max_commit
@@ -124,6 +128,9 @@ def set_config():
124
128
  global min_commit_length
125
129
  min_commit_length = config().min_commit_length
126
130
 
131
+ global clear_after_commit
132
+ clear_after_commit = bool(config().clear_after_commit)
133
+
127
134
  global dev_mode
128
135
  dev_mode = config().dev_mode
129
136
  global dev_follow
@@ -145,6 +152,7 @@ def read_config(autocfg=True):
145
152
  config().setdefault("push_tags", push_tags)
146
153
  config().setdefault("show_changes", show_changes)
147
154
  config().setdefault("min_commit_length", min_commit_length)
155
+ config().setdefault("clear_after_commit", clear_after_commit)
148
156
  config().setdefault("dev_mode", dev_mode)
149
157
  config().setdefault("dev_follow", dev_follow)
150
158
  config().setdefault("dev_follow_max", dev_follow_max)
@@ -164,6 +172,7 @@ def write_config():
164
172
  config().auto_switch = bool(int(gt("auto_switch").get_val()))
165
173
  config().push_tags = bool(int(gt("push_tags").get_val()))
166
174
  config().show_changes = bool(int(gt("show_changes").get_val()))
175
+ config().clear_after_commit = bool(int(gt("clear_after_commit").get_val()))
167
176
  config().min_commit_length = int(gt("min_commit_length").get_val())
168
177
  config().dev_mode = bool(int(gt("dev_mode").get_val()))
169
178
  if dev_mode:
@@ -182,6 +191,18 @@ PREFS_CAP_W = 27
182
191
  PREFS_ENTRY_W = 7
183
192
 
184
193
 
194
+ def trackgit_name(nam):
195
+ userhome = os.path.expanduser("~")
196
+ if nam.startswith(userhome + os.sep):
197
+ nam = nam.replace(userhome, "~")
198
+ return nam
199
+
200
+
201
+ def update_workspace():
202
+ write_config()
203
+ set_workspace()
204
+
205
+
185
206
  def get_main():
186
207
  read_config()
187
208
 
@@ -195,17 +216,17 @@ def get_main():
195
216
  TileRows(
196
217
  source=[
197
218
  TileLabel(caption=""),
198
- TileDirectorySelect(
199
- caption="select workspace",
200
- commandtext="...",
201
- icon=get_icon(ICO_FOLDER_OPEN),
202
- width=30,
219
+ TileEntry(
220
+ caption="workspace folders",
221
+ # commandtext="...",
222
+ # icon=get_icon(ICO_FOLDER_OPEN),
223
+ width=60,
203
224
  idn="workspace",
204
- path=frepo.name,
205
- on_select=lambda x: write_config(),
225
+ value=frepo,
226
+ on_change=lambda o, n: update_workspace(),
206
227
  ),
207
228
  TileLabel(
208
- caption="refresh tracked git's on the next tab manually"
229
+ caption="use ';' as separator for multiple workspaces"
209
230
  ),
210
231
  TileLabel(caption=""),
211
232
  TileEntryInt(
@@ -279,7 +300,8 @@ def get_main():
279
300
  max_show=15,
280
301
  width=40,
281
302
  select_many=True,
282
- map_value=lambda x: os.path.basename(x),
303
+ map_value=lambda x: trackgit_name(
304
+ x), # os.path.basename(x),
283
305
  on_sel=lambda x: set_tracked_gits(),
284
306
  ),
285
307
  TileCols(
@@ -490,6 +512,11 @@ def get_main():
490
512
  idn="push_tags",
491
513
  on_click=lambda x: write_config(),
492
514
  ),
515
+ TileCheckbutton(
516
+ caption="clear message after commit",
517
+ idn="clear_after_commit",
518
+ on_click=lambda x: write_config(),
519
+ ),
493
520
  ]
494
521
  ),
495
522
  ]
@@ -648,8 +675,13 @@ def on_cmd_diff(info, diff_, ignore_switch=False):
648
675
  run_first = True
649
676
  for rec in sel:
650
677
  if rec["type"] == "file":
651
- pg = FileStat(gws.base_repo_dir.name).join([rec["git"]]).name
678
+
679
+ gitnam = rec["git"]
680
+ do_log(f"--- {gitnam}")
681
+
682
+ pg = FileStat(gitnam).name
652
683
  git = gws.find(pg)[0]
684
+
653
685
  logs = []
654
686
  rc = diff_(git.path, rec["file"], callb=logs.append)
655
687
 
@@ -763,7 +795,8 @@ def on_formatter():
763
795
  cfg = {".py": {"cmd": "black", "para": ["%file"]}}
764
796
 
765
797
  for rec in sel:
766
- repo = FileStat(gws.base_repo_dir.name).join([rec["git"]]).name
798
+ gitnam = rec["git"]
799
+ repo = FileStat(gitnam).name
767
800
  fnam = rec["file"]
768
801
  p = FileStat(repo).join([fnam])
769
802
 
@@ -878,7 +911,8 @@ def sel_tracked():
878
911
  def on_gits_cmd(info, selcmd_, gits, ignore_switch=False, update_change=False):
879
912
  do_log_time(info, ignore_switch)
880
913
  for rec in gits:
881
- pg = FileStat(gws.base_repo_dir.name).join([rec["git"]]).name
914
+ gitnam = rec["git"]
915
+ pg = FileStat(gitnam).name
882
916
  git = gws.find(pg)[0]
883
917
  logs = []
884
918
  rc = selcmd_(git.path, [rec["file"]], callb=logs.append)
@@ -967,12 +1001,12 @@ def on_changed_context(cntrl, ctx):
967
1001
  gnam_base = changes[row_no]['git']
968
1002
  fnam_base = changes[row_no]['file']
969
1003
 
970
- gnam = FileStat(gws.base_repo_dir.name).join([gnam_base])
1004
+ gnam = FileStat(gnam_base)
971
1005
  gnam_dir = gnam.name
972
1006
 
973
- fnam = FileStat(gws.base_repo_dir.name).join([gnam_base, fnam_base])
1007
+ fnam = FileStat(gnam_base).join([fnam_base])
974
1008
  fnam_dir = fnam.dirname()
975
- fnam_dirnam = fnam.dirname()[len(gnam.name)+1:]
1009
+ fnam_dirnam = fnam.dirname()[len(gnam.name) + 1:]
976
1010
 
977
1011
  dgb_pr(gnam_base, gnam)
978
1012
  dgb_pr(fnam_base, fnam)
@@ -1023,13 +1057,18 @@ def load_and_set_context_settings(ctxmenu, gnam_dir, fnam_dir, fnam):
1023
1057
  dgb_pr("json parsing error")
1024
1058
  return
1025
1059
 
1026
- env = {"$GIT": gnam_dir, "$PATH": fnam_dir, "$FILE": fnam}
1060
+ env = {"$GIT": gnam_dir, "$PATH": fnam_dir,
1061
+ "$FILE": fnam, "$PYTHON": sys.executable}
1062
+ dgb_pr("env: " + str(env))
1027
1063
 
1028
1064
  cfg = replace_all_vars(cfg, env)
1029
1065
  dgb_pr(cfg)
1030
1066
 
1031
1067
  for _, ctxset in cfg.items():
1032
1068
 
1069
+ workdir = ctxset.setdefault("workdir", ".")
1070
+ dgb_pr("workdir for command", workdir)
1071
+
1033
1072
  patnli = ctxset["expr"]
1034
1073
  if patnli:
1035
1074
  patnli = patnli if type(patnli) == list else [patnli]
@@ -1047,9 +1086,13 @@ def load_and_set_context_settings(ctxmenu, gnam_dir, fnam_dir, fnam):
1047
1086
  def _runner(x):
1048
1087
  if args is None or len(args) == 0:
1049
1088
  return
1050
- dgb_pr(*args)
1051
- rc = os.spawnvpe(os.P_NOWAIT, args[0], args, os.environ)
1052
- dgb_pr("call result", rc)
1089
+ dgb_pr("run command", *args)
1090
+
1091
+ with PushDir(workdir) as pd:
1092
+ rc = os.spawnvpe(
1093
+ os.P_NOWAIT, args[0], args, os.environ)
1094
+ dgb_pr("call result", rc)
1095
+
1053
1096
  return _runner
1054
1097
  ctxmenu.add_command(
1055
1098
  mi[0], _run(mi[1]))
@@ -1103,6 +1146,8 @@ def set_commits():
1103
1146
  commits.set_index(0)
1104
1147
  gt("commit_long").set_val(commit_history[0]["long"])
1105
1148
 
1149
+ apply_clear_after_commit()
1150
+
1106
1151
 
1107
1152
  def on_sel_commit(idx):
1108
1153
  dgb_pr(idx)
@@ -1123,12 +1168,20 @@ def on_commit():
1123
1168
  body = gt("commit_long").get_val().strip()
1124
1169
 
1125
1170
  if len(head) < min_commit_length or len(head) > 50:
1171
+
1172
+ gt("maintabs").select("tab_commit")
1173
+
1126
1174
  tkinter.messagebox.showerror(
1127
1175
  "error",
1128
1176
  f"length: {min_commit_length} >= message < 50\ncurrent: {len(head)}",
1129
1177
  )
1178
+
1179
+ gt("commit_short").focus()
1180
+
1130
1181
  return False
1131
1182
 
1183
+ apply_clear_after_commit()
1184
+
1132
1185
  message = head
1133
1186
  if len(body) > 0:
1134
1187
  message += "\n" * 2 + body
@@ -1213,7 +1266,7 @@ def on_push_all_workspace():
1213
1266
  def set_workspace(update=True):
1214
1267
  dgb_pr("refresh_workspace")
1215
1268
  global gws
1216
- gws = GitWorkspace(frepo.name)
1269
+ gws = GitWorkspace(frepo)
1217
1270
  gws.refresh()
1218
1271
  gt("gits").set_values(sorted(gws.gits.keys()))
1219
1272
  dgb_pr("gws", gws)
@@ -1250,7 +1303,12 @@ def set_changes():
1250
1303
  fs = FileStat(path, prefetch=True)
1251
1304
  if not fs.exists():
1252
1305
  continue
1253
- gitnam = fs.basename()
1306
+
1307
+ userhome = os.path.expanduser("~")
1308
+
1309
+ gitnam = fs.name # fs.basename()
1310
+ if gitnam.startswith(userhome + os.sep):
1311
+ gitnam = gitnam.replace(userhome, "~")
1254
1312
 
1255
1313
  git = git[0]
1256
1314
  git.refresh_status()
@@ -1276,6 +1334,12 @@ def set_changes():
1276
1334
  gt("changes").set_values(changes)
1277
1335
 
1278
1336
 
1337
+ def apply_clear_after_commit():
1338
+ if clear_after_commit:
1339
+ gt("commit_short").set_val("")
1340
+ gt("commit_long").set_val("")
1341
+
1342
+
1279
1343
  def startup_gui():
1280
1344
  # read_config()
1281
1345
  read_commit()
@@ -1288,6 +1352,7 @@ def startup_gui():
1288
1352
  gt("auto_switch").set_val(auto_switch)
1289
1353
  gt("push_tags").set_val(push_tags)
1290
1354
  gt("show_changes").set_val(show_changes)
1355
+ gt("clear_after_commit").set_val(clear_after_commit)
1291
1356
  gt("dev_mode").set_val(dev_mode)
1292
1357
  if dev_mode:
1293
1358
  gt("dev_follow").set_val(dev_follow)
@@ -143,6 +143,7 @@ def main_func(debug_=False):
143
143
  TileCols(
144
144
  source=[
145
145
  TileLabelButton(
146
+ idn="closeapp",
146
147
  caption="close app",
147
148
  commandtext="good bye - click button or 2x ESC (quickly)",
148
149
  icon=get_icon("right-from-bracket"),
@@ -174,4 +175,10 @@ def main_func(debug_=False):
174
175
 
175
176
  startup_gui()
176
177
 
177
- mainframe.mainloop()
178
+ gt("closeapp").focus()
179
+
180
+ try:
181
+ mainframe.mainloop()
182
+ except KeyboardInterrupt:
183
+ print("cntrl+c")
184
+ quit_all(mainframe)
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gitonic
3
- Version: 0.0.14
3
+ Version: 0.16.0
4
4
  Summary: manage a multi git workspace
5
5
  Home-page: https://github.com/kr-g/gitonic
6
6
  Author: k. goger
7
7
  Author-email: k.r.goger+gitonic@gmail.com
8
8
  License: AGPLv3+
9
9
  Keywords: python utility shell git git-workspace tkinter
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 3 - Alpha
12
11
  Classifier: Operating System :: POSIX :: Linux
13
12
  Classifier: Environment :: Other Environment
@@ -17,19 +16,37 @@ Classifier: Topic :: Desktop Environment
17
16
  Classifier: Topic :: Software Development :: Version Control :: Git
18
17
  Classifier: Programming Language :: Python :: 3
19
18
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
20
- Requires-Python: >=3.10
19
+ Requires-Python: >=3.12
21
20
  Description-Content-Type: text/markdown
22
- Provides-Extra: DEFAULT
23
- Provides-Extra: MELD
24
- Provides-Extra: PEP08
25
- Provides-Extra: PEP08_BLACK
26
- Provides-Extra: PEP08_FULL
27
21
  License-File: LICENSE.md
22
+ Requires-Dist: pytkfaicons
23
+ Requires-Dist: tkinter-tooltip
24
+ Provides-Extra: pep08
25
+ Requires-Dist: pycodestyle; extra == "pep08"
26
+ Requires-Dist: flake8; extra == "pep08"
27
+ Requires-Dist: autopep8; extra == "pep08"
28
+ Provides-Extra: pep08-black
29
+ Requires-Dist: pycodestyle; extra == "pep08-black"
30
+ Requires-Dist: flake8; extra == "pep08-black"
31
+ Requires-Dist: black; extra == "pep08-black"
32
+ Provides-Extra: pep08-full
33
+ Requires-Dist: pycodestyle; extra == "pep08-full"
34
+ Requires-Dist: flake8; extra == "pep08-full"
35
+ Requires-Dist: autopep8; extra == "pep08-full"
36
+ Requires-Dist: black; extra == "pep08-full"
37
+ Requires-Dist: yapf; extra == "pep08-full"
38
+ Provides-Extra: meld
39
+ Requires-Dist: meld; extra == "meld"
40
+ Provides-Extra: default
41
+ Requires-Dist: pycodestyle; extra == "default"
42
+ Requires-Dist: flake8; extra == "default"
43
+ Requires-Dist: autopep8; extra == "default"
44
+ Requires-Dist: meld; extra == "default"
28
45
 
29
46
  [![PEP-08](https://img.shields.io/badge/code%20style-PEP08-green.svg)](https://www.python.org/dev/peps/pep-0008/)
30
47
 
31
48
 
32
- you are reading VERSION = v0.0.14
49
+ you are reading VERSION = v0.16.0
33
50
 
34
51
 
35
52
  # gitonic
@@ -211,8 +228,12 @@ files with extension `.pyx` change the setting to
211
228
 
212
229
  black is also an offical python tool, but resolves not fully to issues reported by pycodestyle.
213
230
  there might be some rework required (from case to case).
214
- result is quite similar to autopep8 beside the list reported by pycodestyle (after formatting)
215
- is a bit longer comparing to autopep8 what does a better job here.
231
+ result is quite similar to
232
+ [autopep8](https://github.com/hhatto/autopep8)
233
+ beside the list reported by pycodestyle (after formatting)
234
+ is a bit longer comparing to
235
+ [autopep8](https://github.com/hhatto/autopep8)
236
+ what does a better job here.
216
237
 
217
238
  {
218
239
  ".py": {
@@ -288,6 +309,7 @@ the general structure is:
288
309
  {
289
310
  "a-context-name-ctx": {
290
311
  "expr": "*",
312
+ "workdir": ".",
291
313
  "menu": [
292
314
  [
293
315
  "some text $GIT",
@@ -309,13 +331,17 @@ the general structure is:
309
331
  }
310
332
 
311
333
 
312
- here the variables `$GIT`, `$PATH`, or `$FILE` are replaced
313
- by the corrosponding path before execution.
334
+ here the variables `$GIT`, `$PATH`, `$FILE`, or `$PYTHON` are replaced
335
+ by the corrosponding path before execution.
336
+ where `$PYTHON` expands to `sys.executable` from `gitonic` runtime.
314
337
 
315
338
  the `expr` key contains a single file pattern, or a list of
316
339
  file patterns - when to enable the context menu.
317
340
  the file pattern is following Unix filename pattern matching.
318
341
 
342
+ the `workdir` key will change the current working directory before running
343
+ the command.
344
+
319
345
  the `menu` array contains the text to display in the menu,
320
346
  and the command params as embedded array.
321
347
 
@@ -365,7 +391,20 @@ for running on linux with xfce.
365
391
  ]
366
392
  ]
367
393
  },
368
- "geany-ctx": {
394
+ "autopep8-ctx": {
395
+ "expr": "*.py",
396
+ "menu": [
397
+ [
398
+ "autopep8 python $FILE",
399
+ [
400
+ "autopep8",
401
+ "-i",
402
+ "$FILE"
403
+ ]
404
+ ]
405
+ ]
406
+ },
407
+ "geany-path": {
369
408
  "expr": [
370
409
  "*.c",
371
410
  "*.cpp",
@@ -380,6 +419,48 @@ for running on linux with xfce.
380
419
  ]
381
420
  ]
382
421
  ]
422
+ },
423
+ "uncrustify-path": {
424
+ "expr": [
425
+ "*.c",
426
+ "*.cpp",
427
+ "*.h"
428
+ ],
429
+ "menu": [
430
+ [
431
+ "uncrustify c $FILE",
432
+ [
433
+ "uncrustify",
434
+ "-c",
435
+ "~/.gitonic/uncrustify.cfg",
436
+ "--replace",
437
+ "$FILE",
438
+ "--no-backup",
439
+ "--if-changed"
440
+ ]
441
+ ]
442
+ ]
443
+ },
444
+ "git-base-tools": {
445
+ "expr": [
446
+ "*"
447
+ ],
448
+ "workdir" : "$GIT",
449
+ "menu": [
450
+ [
451
+ "gitk $GIT",
452
+ [
453
+ "gitk"
454
+ ]
455
+ ],
456
+ [
457
+ "git gui $GIT",
458
+ [
459
+ "git",
460
+ "gui"
461
+ ]
462
+ ]
463
+ ]
383
464
  }
384
465
  }
385
466
 
@@ -390,6 +471,8 @@ the sample config file provides support for opening
390
471
  - `.gitignore` file for selected repo with [`xed`](https://en.wikipedia.org/wiki/Xed)
391
472
  - [`spyder-ide.org`](https://spyder-ide.org/), for files matching `*.py`
392
473
  - [`geany`](https://www.geany.org/), for files matching `*.c`, `*.cpp`, `*.h`
474
+ - `gitk` and `git gui` the base git tools which are automatically installed with `git`
475
+ -
393
476
 
394
477
 
395
478
  **limitation:**
@@ -566,7 +649,31 @@ gitonic is released under the following
566
649
  # Changelog
567
650
 
568
651
 
569
- # version v0.0.14 - 20240518
652
+ ## version v0.16.0 - 20250219
653
+
654
+ - support for multiple repo workspaces
655
+ - on `settings` tab the `workspaces` entry field accepts a
656
+ list of paths separated by `;`
657
+ - use `~` for user-home path
658
+ - blanks between `;` separated paths are ignored
659
+ - when using double or single quotes around paths make sure the `;` exists to separate paths
660
+ - blanks at the start or end of paths are not supported
661
+ - added `$PYTHON` to context menu variables
662
+ - added clear message after commit select box
663
+ - added keyboard interrupt cntrl+c handler
664
+ - added `workdir` key for context menu handlers
665
+ - changing versioning scheme in pypi
666
+ -
667
+
668
+
669
+ ## version v0.0.15 - 20240812
670
+
671
+ - fix: blank in path will show file as deleted
672
+ - fix: rename file with git
673
+ -
674
+
675
+
676
+ ## version v0.0.14 - 20240518
570
677
 
571
678
  - improved formatter
572
679
  - support for multiple file extension for single config entry
@@ -583,13 +690,13 @@ gitonic is released under the following
583
690
  -
584
691
 
585
692
 
586
- # version v0.0.13 - 20231125
693
+ ## version v0.0.13 - 20231125
587
694
 
588
695
  - show all untracked files on changes tab (not only the folder)
589
696
  -
590
697
 
591
698
 
592
- # version v0.0.12 - 20231111
699
+ ## version v0.0.12 - 20231111
593
700
 
594
701
  - support for more code formatters (included in standard installation as extras)
595
702
  - install with `pip install gitonic[PEP08]`
@@ -604,7 +711,7 @@ gitonic is released under the following
604
711
  -
605
712
 
606
713
 
607
- # version v0.0.11 - 20230710
714
+ ## version v0.0.11 - 20230710
608
715
 
609
716
  - fixed logging
610
717
  - fix no branch crash when no branch is set up
@@ -617,20 +724,20 @@ gitonic is released under the following
617
724
  -
618
725
 
619
726
 
620
- # version v0.0.10 - 20230225
727
+ ## version v0.0.10 - 20230225
621
728
 
622
729
  - sort files in changes tab
623
730
  -
624
731
 
625
732
 
626
- # version v0.0.9 - 20221008
733
+ ## version v0.0.9 - 20221008
627
734
 
628
735
  - git current branch in changes tab
629
736
  - support for black
630
737
  -
631
738
 
632
739
 
633
- # version v0.0.8 - 20220802
740
+ ## version v0.0.8 - 20220802
634
741
 
635
742
  - bug fix, due to corrupted local env
636
743
  - double click in changes view will stage/ unstage a file
@@ -1469,5 +1576,3 @@ https://www.gnu.org/licenses/agpl-3.0.de.html
1469
1576
 
1470
1577
 
1471
1578
 
1472
-
1473
-
@@ -1,6 +1,2 @@
1
1
  [console_scripts]
2
2
  gitonic = gitonic.__main__:main_func
3
-
4
- [gui_scripts]
5
-
6
-
@@ -13,6 +13,10 @@ setuptools.setup(
13
13
  entry_points=entry_points,
14
14
  )
15
15
 
16
+ # !!!
17
+ # python3 patch_version.py
18
+ # !!!
19
+
16
20
  # python3 -m setup sdist build bdist_wheel
17
21
 
18
22
  # test.pypi
@@ -1 +0,0 @@
1
- VERSION = "v0.0.14"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,27 +2,27 @@ pytkfaicons
2
2
  tkinter-tooltip
3
3
 
4
4
  [DEFAULT]
5
- autopep8
5
+ pycodestyle
6
6
  flake8
7
+ autopep8
7
8
  meld
8
- pycodestyle
9
9
 
10
10
  [MELD]
11
11
  meld
12
12
 
13
13
  [PEP08]
14
- autopep8
15
- flake8
16
14
  pycodestyle
15
+ flake8
16
+ autopep8
17
17
 
18
18
  [PEP08_BLACK]
19
- black
20
- flake8
21
19
  pycodestyle
20
+ flake8
21
+ black
22
22
 
23
23
  [PEP08_FULL]
24
+ pycodestyle
25
+ flake8
24
26
  autopep8
25
27
  black
26
- flake8
27
- pycodestyle
28
28
  yapf
File without changes
File without changes