git-editlog 1.0.1__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-editlog
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Auto commit edit log for Git
5
5
  Home-page: https://ktpanda.org/software/git-editlog
6
6
  Author: Katie Rust
@@ -1,4 +1,4 @@
1
- VERSION = "1.0.1"
1
+ VERSION = "1.0.2"
2
2
 
3
3
  import sys
4
4
 
@@ -22,9 +22,36 @@ def setup_python_logging(verbose=False):
22
22
  console_handler.setFormatter(log_formatter)
23
23
  root.addHandler(console_handler)
24
24
 
25
+
26
+ def add_repo_list(fpath, repo_paths, seen_paths, limit):
27
+ cdir = fpath.parent
28
+ with fpath.open(encoding='utf8') as fp:
29
+ for line in fp:
30
+ line = line.strip()
31
+ if not line or line.startswith('#'):
32
+ continue
33
+ add_repo(cdir, line, repo_paths, seen_paths, limit - 1)
34
+
35
+ def add_repo(cdir, name, repo_paths, seen_paths, limit=10):
36
+ if is_list := name.startswith('@'):
37
+ name = name[1:].lstrip()
38
+
39
+ path = cdir / name
40
+ if path in seen_paths:
41
+ return
42
+
43
+ seen_paths.add(path)
44
+
45
+ if is_list:
46
+ if limit <= 0:
47
+ return
48
+ add_repo_list(path, repo_paths, seen_paths, limit)
49
+ else:
50
+ repo_paths.append(path)
51
+
25
52
  def main():
26
53
  p = argparse.ArgumentParser(description='')
27
- p.add_argument('repos', type=Path, nargs='*')
54
+ p.add_argument('repos', nargs='*')
28
55
  p.add_argument('-l', '--repo-list', type=Path)
29
56
  p.add_argument('-v', '--verbose', action='store_true', help='')
30
57
  #p.add_argument(help='')
@@ -33,20 +60,16 @@ def main():
33
60
  setup_python_logging(args.verbose)
34
61
 
35
62
  repo_paths = []
63
+ seen_paths = set()
36
64
  repo_watchers = []
65
+
66
+ cdir = Path('.')
67
+
37
68
  for path in args.repos:
38
- repo_paths.append(path)
69
+ add_repo(cdir, path, repo_paths, seen_paths)
39
70
 
40
71
  if args.repo_list:
41
- base = args.repo_list.parent
42
- with args.repo_list.open() as fp:
43
- for line in fp:
44
- line = line.strip()
45
- if not line or line.startswith('#'):
46
- continue
47
-
48
- path = (base / line).absolute()
49
- repo_paths.append(path)
72
+ add_repo_list(args.repo_list, repo_paths, seen_paths, 10)
50
73
 
51
74
  for path in repo_paths:
52
75
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-editlog
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Auto commit edit log for Git
5
5
  Home-page: https://ktpanda.org/software/git-editlog
6
6
  Author: Katie Rust
File without changes
File without changes
File without changes
File without changes
File without changes