fancygit 1.0.18__tar.gz → 1.0.19__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 (65) hide show
  1. {fancygit-1.0.18 → fancygit-1.0.19}/MANIFEST.in +1 -0
  2. {fancygit-1.0.18 → fancygit-1.0.19}/PKG-INFO +1 -1
  3. fancygit-1.0.19/VERSION +1 -0
  4. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/PKG-INFO +1 -1
  5. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/SOURCES.txt +5 -0
  6. fancygit-1.0.19/images/Logo.png +0 -0
  7. fancygit-1.0.19/images/Logo_with_name.png +0 -0
  8. fancygit-1.0.19/images/dark_background_logo.png +0 -0
  9. fancygit-1.0.19/images/light_background_logo.png +0 -0
  10. fancygit-1.0.19/images/overview.png +0 -0
  11. {fancygit-1.0.18 → fancygit-1.0.19}/setup.py +16 -1
  12. {fancygit-1.0.18 → fancygit-1.0.19}/src/mermaid_export.py +85 -2
  13. fancygit-1.0.18/VERSION +0 -1
  14. {fancygit-1.0.18 → fancygit-1.0.19}/.fancygit_config +0 -0
  15. {fancygit-1.0.18 → fancygit-1.0.19}/CD_GUIDE.md +0 -0
  16. {fancygit-1.0.18 → fancygit-1.0.19}/COLOR_SYSTEM_GUIDE.md +0 -0
  17. {fancygit-1.0.18 → fancygit-1.0.19}/EMAIL_SETUP_GUIDE.md +0 -0
  18. {fancygit-1.0.18 → fancygit-1.0.19}/LICENSE +0 -0
  19. {fancygit-1.0.18 → fancygit-1.0.19}/README.md +0 -0
  20. {fancygit-1.0.18 → fancygit-1.0.19}/TESTING_GUIDE.md +0 -0
  21. {fancygit-1.0.18 → fancygit-1.0.19}/TESTING_SUMMARY.md +0 -0
  22. {fancygit-1.0.18 → fancygit-1.0.19}/command-list.txt +0 -0
  23. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/dependency_links.txt +0 -0
  24. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/entry_points.txt +0 -0
  25. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/requires.txt +0 -0
  26. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.egg-info/top_level.txt +0 -0
  27. {fancygit-1.0.18 → fancygit-1.0.19}/fancygit.py +0 -0
  28. {fancygit-1.0.18 → fancygit-1.0.19}/setup.cfg +0 -0
  29. {fancygit-1.0.18 → fancygit-1.0.19}/src/__init__.py +0 -0
  30. {fancygit-1.0.18 → fancygit-1.0.19}/src/ai_engine.py +0 -0
  31. {fancygit-1.0.18 → fancygit-1.0.19}/src/colors.py +0 -0
  32. {fancygit-1.0.18 → fancygit-1.0.19}/src/config_manager.py +0 -0
  33. {fancygit-1.0.18 → fancygit-1.0.19}/src/fancygit_config_dc.py +0 -0
  34. {fancygit-1.0.18 → fancygit-1.0.19}/src/git_error.py +0 -0
  35. {fancygit-1.0.18 → fancygit-1.0.19}/src/git_error_parser.py +0 -0
  36. {fancygit-1.0.18 → fancygit-1.0.19}/src/git_insights.py +0 -0
  37. {fancygit-1.0.18 → fancygit-1.0.19}/src/git_runner.py +0 -0
  38. {fancygit-1.0.18 → fancygit-1.0.19}/src/loading_animation.py +0 -0
  39. {fancygit-1.0.18 → fancygit-1.0.19}/src/merge_conflict.py +0 -0
  40. {fancygit-1.0.18 → fancygit-1.0.19}/src/model_provider.py +0 -0
  41. {fancygit-1.0.18 → fancygit-1.0.19}/src/output_colorizer.py +0 -0
  42. {fancygit-1.0.18 → fancygit-1.0.19}/src/providers/__init__.py +0 -0
  43. {fancygit-1.0.18 → fancygit-1.0.19}/src/providers/anthropic_model.py +0 -0
  44. {fancygit-1.0.18 → fancygit-1.0.19}/src/providers/base_model.py +0 -0
  45. {fancygit-1.0.18 → fancygit-1.0.19}/src/providers/ollama_model.py +0 -0
  46. {fancygit-1.0.18 → fancygit-1.0.19}/src/providers/openai_model.py +0 -0
  47. {fancygit-1.0.18 → fancygit-1.0.19}/src/repo_inspector.py +0 -0
  48. {fancygit-1.0.18 → fancygit-1.0.19}/src/repo_state.py +0 -0
  49. {fancygit-1.0.18 → fancygit-1.0.19}/src/utils.py +0 -0
  50. {fancygit-1.0.18 → fancygit-1.0.19}/tests/__init__.py +0 -0
  51. {fancygit-1.0.18 → fancygit-1.0.19}/tests/conftest.py +0 -0
  52. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_ai_engine.py +0 -0
  53. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_ai_integration.py +0 -0
  54. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_config_manager.py +0 -0
  55. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_conflict_parser_integration.py +0 -0
  56. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_fancygit_advanced.py +0 -0
  57. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_fancygit_commands.py +0 -0
  58. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_fancygit_integration.py +0 -0
  59. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_fancygit_workflows.py +0 -0
  60. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_git_error.py +0 -0
  61. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_git_error_parser.py +0 -0
  62. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_git_runner.py +0 -0
  63. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_model_provider.py +0 -0
  64. {fancygit-1.0.18 → fancygit-1.0.19}/tests/test_providers.py +0 -0
  65. {fancygit-1.0.18 → fancygit-1.0.19}/welcome.py +0 -0
@@ -7,5 +7,6 @@ include welcome.py
7
7
  include fancygit.py
8
8
  recursive-include src *.py
9
9
  recursive-include tests *.py
10
+ recursive-include images *.png *.jpg *.jpeg *.gif
10
11
  global-exclude *.pyc
11
12
  global-exclude __pycache__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fancygit
3
- Version: 1.0.18
3
+ Version: 1.0.19
4
4
  Summary: A smart CLI tool that provides intelligent recommendations and helps solve merge conflicts
5
5
  Author: Youssif Ashmawy
6
6
  Author-email: ashmawyyoussif@gmail.com
@@ -0,0 +1 @@
1
+ 1.0.19
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fancygit
3
- Version: 1.0.18
3
+ Version: 1.0.19
4
4
  Summary: A smart CLI tool that provides intelligent recommendations and helps solve merge conflicts
5
5
  Author: Youssif Ashmawy
6
6
  Author-email: ashmawyyoussif@gmail.com
@@ -18,6 +18,11 @@ fancygit.egg-info/dependency_links.txt
18
18
  fancygit.egg-info/entry_points.txt
19
19
  fancygit.egg-info/requires.txt
20
20
  fancygit.egg-info/top_level.txt
21
+ images/Logo.png
22
+ images/Logo_with_name.png
23
+ images/dark_background_logo.png
24
+ images/light_background_logo.png
25
+ images/overview.png
21
26
  src/__init__.py
22
27
  src/ai_engine.py
23
28
  src/colors.py
Binary file
Binary file
@@ -15,7 +15,10 @@ class CustomBuildPy(_build_py):
15
15
  shutil.copy('.fancygit_config', os.path.join(build_lib, '.fancygit_config'))
16
16
  # Copy images folder for logo files
17
17
  if os.path.exists('images'):
18
- shutil.copytree('images', os.path.join(build_lib, 'images'))
18
+ images_build_dir = os.path.join(build_lib, 'images')
19
+ if os.path.exists(images_build_dir):
20
+ shutil.rmtree(images_build_dir)
21
+ shutil.copytree('images', images_build_dir)
19
22
 
20
23
  import os
21
24
 
@@ -67,6 +70,18 @@ setup(
67
70
  packages=find_packages(),
68
71
  py_modules=["fancygit", "welcome"],
69
72
  include_package_data=True,
73
+ package_data={
74
+ '': ['images/*.png', 'images/*.jpg', 'images/*.jpeg', 'images/*.gif'],
75
+ },
76
+ data_files=[
77
+ ('share/fancygit/images', [
78
+ 'images/Logo.png',
79
+ 'images/Logo_with_name.png',
80
+ 'images/dark_background_logo.png',
81
+ 'images/light_background_logo.png',
82
+ 'images/overview.png'
83
+ ]),
84
+ ],
70
85
  cmdclass={'build_py': CustomBuildPy},
71
86
  classifiers=[
72
87
  "Development Status :: 4 - Beta",
@@ -3,11 +3,90 @@ import os
3
3
  import re
4
4
  import textwrap
5
5
  from datetime import datetime
6
+ try:
7
+ import importlib.resources as resources
8
+ except ImportError:
9
+ import importlib_resources as resources
6
10
 
7
11
 
8
12
  class MermaidExporter:
9
13
  def __init__(self, runner):
10
14
  self.runner = runner
15
+ self._image_base_path = self._get_image_base_path()
16
+
17
+ def _get_image_base_path(self) -> str:
18
+ """Get the base path for images, handling both development and installed environments"""
19
+ # Try to get the path from installed package data first
20
+ try:
21
+ # When installed, try to find images in the package
22
+ if resources.is_resource('fancygit', 'images'):
23
+ return resources.files('fancygit').joinpath('images')
24
+ except Exception:
25
+ pass
26
+
27
+ # Fallback to development environment - look relative to this file
28
+ current_dir = os.path.dirname(os.path.abspath(__file__))
29
+ project_root = os.path.dirname(current_dir)
30
+ images_path = os.path.join(project_root, 'images')
31
+
32
+ if os.path.exists(images_path):
33
+ return images_path
34
+
35
+ # Final fallback - assume images are in the same directory as the HTML
36
+ return '.'
37
+
38
+ def _get_image_url(self, image_name: str) -> str:
39
+ """Get proper URL for image files"""
40
+ # First try to get the file as a resource (installed package)
41
+ try:
42
+ if resources.is_resource('fancygit', f'images/{image_name}'):
43
+ # For installed packages, we'll embed the image as base64
44
+ image_path = resources.files('fancygit').joinpath('images', image_name)
45
+ if hasattr(image_path, 'read_bytes'):
46
+ # Python 3.9+ Path object
47
+ return self._bytes_to_base64(image_path.read_bytes(), image_name)
48
+ elif os.path.exists(str(image_path)):
49
+ return self._image_to_base64(str(image_path))
50
+ except Exception:
51
+ pass
52
+
53
+ # In development, use absolute path
54
+ abs_path = os.path.join(self._image_base_path, image_name)
55
+ if os.path.exists(abs_path):
56
+ return self._image_to_base64(abs_path)
57
+
58
+ # If not found, return empty string to avoid broken images
59
+ return ''
60
+
61
+ def _bytes_to_base64(self, image_bytes: bytes, image_name: str) -> str:
62
+ """Convert image bytes to base64 data URL"""
63
+ try:
64
+ import base64
65
+ encoded = base64.b64encode(image_bytes).decode('utf-8')
66
+
67
+ # Determine MIME type
68
+ if image_name.lower().endswith('.png'):
69
+ mime_type = 'image/png'
70
+ elif image_name.lower().endswith(('.jpg', '.jpeg')):
71
+ mime_type = 'image/jpeg'
72
+ elif image_name.lower().endswith('.gif'):
73
+ mime_type = 'image/gif'
74
+ else:
75
+ mime_type = 'image/png' # default
76
+
77
+ return f'data:{mime_type};base64,{encoded}'
78
+ except Exception:
79
+ return ''
80
+
81
+ def _image_to_base64(self, image_path: str) -> str:
82
+ """Convert image file to base64 data URL"""
83
+ try:
84
+ with open(image_path, 'rb') as img_file:
85
+ image_bytes = img_file.read()
86
+ image_name = os.path.basename(image_path)
87
+ return self._bytes_to_base64(image_bytes, image_name)
88
+ except Exception:
89
+ return ''
11
90
 
12
91
  def _git(self, args):
13
92
  return self.runner.run_git_command(args)
@@ -456,6 +535,10 @@ class MermaidExporter:
456
535
  def build_html(self, diagrams: dict, title: str = 'FancyGit Repository Visualization') -> str:
457
536
  payload = json.dumps(diagrams)
458
537
  now = datetime.now().isoformat(timespec='seconds')
538
+
539
+ # Get proper image URLs
540
+ light_logo_url = self._get_image_url('light_background_logo.png')
541
+ dark_logo_url = self._get_image_url('dark_background_logo.png')
459
542
 
460
543
  return textwrap.dedent(
461
544
  f"""\
@@ -551,7 +634,7 @@ class MermaidExporter:
551
634
  .logo {{
552
635
  width: 80px;
553
636
  height: 80px;
554
- background-image: url('../images/light_background_logo.png');
637
+ background-image: url('{light_logo_url}');
555
638
  background-size: contain;
556
639
  background-repeat: no-repeat;
557
640
  background-position: center;
@@ -563,7 +646,7 @@ class MermaidExporter:
563
646
  }}
564
647
 
565
648
  [data-theme="dark"] .logo {{
566
- background-image: url('../images/dark_background_logo.png');
649
+ background-image: url('{dark_logo_url}');
567
650
  }}
568
651
 
569
652
  .meta {{
fancygit-1.0.18/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.0.18
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes