githydra 1.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 githydra might be problematic. Click here for more details.

Files changed (40) hide show
  1. githydra-1.0.0/LICENSE +26 -0
  2. githydra-1.0.0/PKG-INFO +173 -0
  3. githydra-1.0.0/README.md +142 -0
  4. githydra-1.0.0/githydra/__init__.py +17 -0
  5. githydra-1.0.0/githydra/__main__.py +289 -0
  6. githydra-1.0.0/githydra/analytics/__init__.py +10 -0
  7. githydra-1.0.0/githydra/analytics/code_analysis.py +18 -0
  8. githydra-1.0.0/githydra/analytics/history.py +21 -0
  9. githydra-1.0.0/githydra/analytics/stats.py +27 -0
  10. githydra-1.0.0/githydra/core/__init__.py +10 -0
  11. githydra-1.0.0/githydra/core/config.py +143 -0
  12. githydra-1.0.0/githydra/core/repository.py +107 -0
  13. githydra-1.0.0/githydra/core/session.py +63 -0
  14. githydra-1.0.0/githydra/help/__init__.py +9 -0
  15. githydra-1.0.0/githydra/help/guides.py +31 -0
  16. githydra-1.0.0/githydra/help/tutorials.py +16 -0
  17. githydra-1.0.0/githydra/localization/__init__.py +9 -0
  18. githydra-1.0.0/githydra/localization/ar.py +31 -0
  19. githydra-1.0.0/githydra/localization/en.py +31 -0
  20. githydra-1.0.0/githydra/operations/__init__.py +11 -0
  21. githydra-1.0.0/githydra/operations/branch.py +28 -0
  22. githydra-1.0.0/githydra/operations/commit.py +25 -0
  23. githydra-1.0.0/githydra/operations/merge.py +24 -0
  24. githydra-1.0.0/githydra/operations/remote.py +24 -0
  25. githydra-1.0.0/githydra/ui/__init__.py +10 -0
  26. githydra-1.0.0/githydra/ui/display.py +268 -0
  27. githydra-1.0.0/githydra/ui/menu.py +109 -0
  28. githydra-1.0.0/githydra/ui/progress.py +97 -0
  29. githydra-1.0.0/githydra/utils/__init__.py +11 -0
  30. githydra-1.0.0/githydra/utils/helpers.py +185 -0
  31. githydra-1.0.0/githydra/utils/logger.py +225 -0
  32. githydra-1.0.0/githydra/utils/validators.py +177 -0
  33. githydra-1.0.0/githydra.egg-info/PKG-INFO +173 -0
  34. githydra-1.0.0/githydra.egg-info/SOURCES.txt +38 -0
  35. githydra-1.0.0/githydra.egg-info/dependency_links.txt +1 -0
  36. githydra-1.0.0/githydra.egg-info/entry_points.txt +2 -0
  37. githydra-1.0.0/githydra.egg-info/requires.txt +2 -0
  38. githydra-1.0.0/githydra.egg-info/top_level.txt +1 -0
  39. githydra-1.0.0/setup.cfg +4 -0
  40. githydra-1.0.0/setup.py +47 -0
githydra-1.0.0/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Abdulaziz Alqudimi
4
+ All rights reserved by Alqudimi Technology
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the “Software”), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ 1. The above copyright notice, including the name of the author
14
+ **Abdulaziz Alqudimi** and the organization **Alqudimi Technology**,
15
+ shall be included in all copies or substantial portions of the Software.
16
+
17
+ 2. Any use of this Software for commercial, research, or educational purposes
18
+ must give clear attribution to the author and the organization.
19
+
20
+ 3. This Software is provided “AS IS”, without warranty of any kind, express or
21
+ implied, including but not limited to the warranties of merchantability,
22
+ fitness for a particular purpose and noninfringement. In no event shall the
23
+ author(s) or copyright holder(s) be liable for any claim, damages, or other
24
+ liability, whether in an action of contract, tort, or otherwise, arising
25
+ from, out of, or in connection with the Software or the use or other
26
+ dealings in the Software.
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: githydra
3
+ Version: 1.0.0
4
+ Summary: Advanced Git Repository Management Tool
5
+ Home-page: https://github.com/Alqudimi/GitHydra
6
+ Author: Abdulaziz Alqudimi
7
+ License: MIT
8
+ Keywords: git cli tui githydra
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Version Control :: Git
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.7
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: GitPython>=3.1.30
19
+ Requires-Dist: rich>=13.0.0
20
+ Dynamic: author
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: keywords
26
+ Dynamic: license
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # GitHydra
33
+
34
+ <div align="center">
35
+
36
+ <img src="https://raw.githubusercontent.com/gist/ManusGPT/b795c7fe006b53e3f79f296310b833a9/raw/e2542018276560642289416559591e5219f8f029/githydra-banner.svg" alt="GitHydra Banner" width="800"/>
37
+
38
+ <h1 align="center">GitHydra: The Definitive Git Command-Line Interface</h1>
39
+
40
+ **أداة سطر أوامر (CLI) من الجيل التالي، مصممة لإعادة تعريف تجربة استخدام Git. تجمع GitHydra بين القوة والأناقة، وتقدم واجهة تفاعلية ذكية وأتمتة قوية لسير عملك اليومي.**
41
+
42
+ <p align="center">
43
+ <a href="#-الميزات-الأساسية"><strong>الميزات</strong></a> ·
44
+ <a href="#-التثبيت"><strong>التثبيت</strong></a> ·
45
+ <a href="#-كيفية-الاستخدام"><strong>الاستخدام</strong></a> ·
46
+ <a href="#-هيكلية-المشروع"><strong>الهيكلية</strong></a> ·
47
+ <a href="#-المساهمة"><strong>المساهمة</strong></a>
48
+ </p>
49
+
50
+ <p align="center">
51
+ <img src="https://img.shields.io/badge/Python-3.7+-blue.svg?style=for-the-badge&logo=python" alt="Python Version">
52
+ <img src="https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge" alt="License">
53
+ <img src="https://img.shields.io/badge/Version-1.0.0-purple.svg?style=for-the-badge" alt="Version">
54
+ <img src="https://img.shields.io/badge/Status-Active-brightgreen.svg?style=for-the-badge" alt="Status">
55
+ </p>
56
+
57
+ </div>
58
+
59
+ ---
60
+
61
+ ## لماذا GitHydra؟
62
+
63
+ Git أداة لا غنى عنها، لكنها قد تكون معقدة ومتكررة. تم بناء **GitHydra** لحل هذه المشكلة. بدلاً من كتابة أوامر Git الطويلة والمعقدة، توفر لك GitHydra تجربة موجهة وقائمة على القوائم، مدعومة بمنطق ذكي لأتمتة المهام الشائعة. إنها الأداة المثالية للمطورين الذين يقدرون الكفاءة والوضوح.
64
+
65
+ ## ✨ الميزات الأساسية
66
+
67
+ | الميزة | الوصف |
68
+ | :--- | :--- |
69
+ | **🐙 واجهة تفاعلية ذكية** | واجهة طرفية غنية (TUI) تستخدم الألوان والأيقونات والجداول لتسهيل فهم حالة المستودع. |
70
+ | **⚡️ عمليات مؤتمتة** | أوامر مثل `Smart Add` و `Smart Push` التي تقلل من الخطوات اليدوية وتسرّع سير العمل. |
71
+ | **📊 تحليلات متقدمة** | احصل على إحصائيات فورية حول المستودع، مثل عدد الـ commits والمساهمين. |
72
+ | **🌍 دعم متعدد اللغات** | واجهة قابلة للتخصيص باللغة **العربية** أو **الإنجليزية** لتجربة محلية. |
73
+ | **⚙️ إعدادات قابلة للتخصيص** | تحكم كامل في سلوك الأداة عبر ملف `config.json` مركزي. |
74
+ | **📝 تسجيل شامل** | نظام تسجيل متقدم يوثق كل عملية، مما يسهل تتبع الأخطاء ومراجعة الأنشطة. |
75
+ | **🌿 إدارة فروع سهلة** | عرض وإنشاء وإدارة الفروع بسهولة من خلال قائمة مخصصة. |
76
+ | **🏗️ هيكلية قابلة للتوسيع** | تصميم برمجي نظيف ومجزأ يسهل على المطورين إضافة ميزات جديدة أو تعديل الميزات الحالية. |
77
+
78
+ ---
79
+
80
+ ## 🚀 التثبيت
81
+
82
+ للبدء مع GitHydra، تأكد من أن لديك **Python 3.7+** و **Git** مثبتين على نظامك.
83
+
84
+ 1. **استنساخ المستودع:**
85
+ ```sh
86
+ git clone https://github.com/Alqudimi/GitHydra.git
87
+ cd GitHydra
88
+ ```
89
+
90
+ 2. **إنشاء بيئة افتراضية (موصى به):**
91
+ ```sh
92
+ python -m venv venv
93
+ source venv/bin/activate # On Windows use `venv\Scripts\activate`
94
+ ```
95
+
96
+ 3. **تثبيت الاعتماديات:**
97
+ ستحتاج إلى إنشاء ملف `requirements.txt` يحتوي على:
98
+ ```txt
99
+ GitPython
100
+ rich
101
+ ```
102
+ ثم قم بتشغيل:
103
+ ```sh
104
+ pip install -r requirements.txt
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 🕹️ كيفية الاستخدام
110
+
111
+ لتشغيل GitHydra، استخدم الأمر التالي من الدليل الجذر للمشروع:
112
+
113
+ ```sh
114
+ python -m githydra
115
+ ```
116
+
117
+ ### وسائط سطر الأوامر
118
+
119
+ يمكنك تخصيص التشغيل باستخدام الوسائط التالية:
120
+
121
+ | الوسيط | الاختصار | الوصف |
122
+ | :--- | :--- | :--- |
123
+ | `--repo` | `-r` | تحديد مسار مستودع Git (الافتراضي: المجلد الحالي). |
124
+ | `--language` | `-l` | اختيار لغة الواجهة (`ar` أو `en`). الافتراضي هو `ar`. |
125
+ | `--version` | `-v` | عرض رقم إصدار الأداة. |
126
+ | `--help` | `-h` | عرض رسالة المساعدة. |
127
+
128
+ **مثال:** تشغيل الأداة على مستودع محدد باللغة الإنجليزية.
129
+ ```sh
130
+ python -m githydra --repo /path/to/project --language en
131
+ ```
132
+
133
+ ---
134
+
135
+ ## 📂 هيكلية المشروع
136
+
137
+ تم تصميم `GitHydra` بهيكلية معيارية (Modular) لضمان سهولة الصيانة والتطوير المستقبلي.
138
+
139
+ ```plaintext
140
+ githydra/
141
+ ├── __main__.py # نقطة الدخول التنفيذية للتطبيق
142
+ ├── analytics/ # وحدات تحليل المستودع (إحصائيات، سجلات)
143
+ ├── core/ # المنطق الأساسي (المستودع، الإعدادات، الجلسات)
144
+ ├── help/ # وحدات المساعدة والدروس التعليمية
145
+ ├── localization/ # ملفات الترجمة ودعم اللغات
146
+ ├── operations/ # منطق عمليات Git (commit, branch, merge)
147
+ ├── ui/ # مكونات واجهة المستخدم (العرض، القوائم، التقدم)
148
+ └── utils/ # أدوات مساعدة (تسجيل، مدققات، دوال عامة)
149
+ ```
150
+
151
+ ---
152
+
153
+ ## 🤝 المساهمة
154
+
155
+ المساهمات هي ما يجعل مجتمع المصادر المفتوحة مكانًا رائعًا للتعلم والإلهام والإبداع. نرحب بأي مساهمات في مشروع `GitHydra`.
156
+
157
+ 1. **قم بعمل Fork** للمشروع.
158
+ 2. **أنشئ فرعًا جديدًا** لميزتك (`git checkout -b feature/NewFeature`).
159
+ 3. **قم بعمل Commit** لتغييراتك (`git commit -m 'feat: Add some NewFeature'`).
160
+ 4. **ارفع تغييراتك** إلى الفرع (`git push origin feature/NewFeature`).
161
+ 5. **افتح طلب سحب (Pull Request)**.
162
+
163
+ ---
164
+
165
+ ## 📄 الترخيص
166
+
167
+ موزع بموجب ترخيص MIT. انظر `LICENSE` لمزيد من المعلومات.
168
+
169
+ <div align="center">
170
+
171
+ **تم التطوير بواسطة عبدالعزيز القديمي**
172
+
173
+ </div>
@@ -0,0 +1,142 @@
1
+ # GitHydra
2
+
3
+ <div align="center">
4
+
5
+ <img src="https://raw.githubusercontent.com/gist/ManusGPT/b795c7fe006b53e3f79f296310b833a9/raw/e2542018276560642289416559591e5219f8f029/githydra-banner.svg" alt="GitHydra Banner" width="800"/>
6
+
7
+ <h1 align="center">GitHydra: The Definitive Git Command-Line Interface</h1>
8
+
9
+ **أداة سطر أوامر (CLI) من الجيل التالي، مصممة لإعادة تعريف تجربة استخدام Git. تجمع GitHydra بين القوة والأناقة، وتقدم واجهة تفاعلية ذكية وأتمتة قوية لسير عملك اليومي.**
10
+
11
+ <p align="center">
12
+ <a href="#-الميزات-الأساسية"><strong>الميزات</strong></a> ·
13
+ <a href="#-التثبيت"><strong>التثبيت</strong></a> ·
14
+ <a href="#-كيفية-الاستخدام"><strong>الاستخدام</strong></a> ·
15
+ <a href="#-هيكلية-المشروع"><strong>الهيكلية</strong></a> ·
16
+ <a href="#-المساهمة"><strong>المساهمة</strong></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <img src="https://img.shields.io/badge/Python-3.7+-blue.svg?style=for-the-badge&logo=python" alt="Python Version">
21
+ <img src="https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge" alt="License">
22
+ <img src="https://img.shields.io/badge/Version-1.0.0-purple.svg?style=for-the-badge" alt="Version">
23
+ <img src="https://img.shields.io/badge/Status-Active-brightgreen.svg?style=for-the-badge" alt="Status">
24
+ </p>
25
+
26
+ </div>
27
+
28
+ ---
29
+
30
+ ## لماذا GitHydra؟
31
+
32
+ Git أداة لا غنى عنها، لكنها قد تكون معقدة ومتكررة. تم بناء **GitHydra** لحل هذه المشكلة. بدلاً من كتابة أوامر Git الطويلة والمعقدة، توفر لك GitHydra تجربة موجهة وقائمة على القوائم، مدعومة بمنطق ذكي لأتمتة المهام الشائعة. إنها الأداة المثالية للمطورين الذين يقدرون الكفاءة والوضوح.
33
+
34
+ ## ✨ الميزات الأساسية
35
+
36
+ | الميزة | الوصف |
37
+ | :--- | :--- |
38
+ | **🐙 واجهة تفاعلية ذكية** | واجهة طرفية غنية (TUI) تستخدم الألوان والأيقونات والجداول لتسهيل فهم حالة المستودع. |
39
+ | **⚡️ عمليات مؤتمتة** | أوامر مثل `Smart Add` و `Smart Push` التي تقلل من الخطوات اليدوية وتسرّع سير العمل. |
40
+ | **📊 تحليلات متقدمة** | احصل على إحصائيات فورية حول المستودع، مثل عدد الـ commits والمساهمين. |
41
+ | **🌍 دعم متعدد اللغات** | واجهة قابلة للتخصيص باللغة **العربية** أو **الإنجليزية** لتجربة محلية. |
42
+ | **⚙️ إعدادات قابلة للتخصيص** | تحكم كامل في سلوك الأداة عبر ملف `config.json` مركزي. |
43
+ | **📝 تسجيل شامل** | نظام تسجيل متقدم يوثق كل عملية، مما يسهل تتبع الأخطاء ومراجعة الأنشطة. |
44
+ | **🌿 إدارة فروع سهلة** | عرض وإنشاء وإدارة الفروع بسهولة من خلال قائمة مخصصة. |
45
+ | **🏗️ هيكلية قابلة للتوسيع** | تصميم برمجي نظيف ومجزأ يسهل على المطورين إضافة ميزات جديدة أو تعديل الميزات الحالية. |
46
+
47
+ ---
48
+
49
+ ## 🚀 التثبيت
50
+
51
+ للبدء مع GitHydra، تأكد من أن لديك **Python 3.7+** و **Git** مثبتين على نظامك.
52
+
53
+ 1. **استنساخ المستودع:**
54
+ ```sh
55
+ git clone https://github.com/Alqudimi/GitHydra.git
56
+ cd GitHydra
57
+ ```
58
+
59
+ 2. **إنشاء بيئة افتراضية (موصى به):**
60
+ ```sh
61
+ python -m venv venv
62
+ source venv/bin/activate # On Windows use `venv\Scripts\activate`
63
+ ```
64
+
65
+ 3. **تثبيت الاعتماديات:**
66
+ ستحتاج إلى إنشاء ملف `requirements.txt` يحتوي على:
67
+ ```txt
68
+ GitPython
69
+ rich
70
+ ```
71
+ ثم قم بتشغيل:
72
+ ```sh
73
+ pip install -r requirements.txt
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 🕹️ كيفية الاستخدام
79
+
80
+ لتشغيل GitHydra، استخدم الأمر التالي من الدليل الجذر للمشروع:
81
+
82
+ ```sh
83
+ python -m githydra
84
+ ```
85
+
86
+ ### وسائط سطر الأوامر
87
+
88
+ يمكنك تخصيص التشغيل باستخدام الوسائط التالية:
89
+
90
+ | الوسيط | الاختصار | الوصف |
91
+ | :--- | :--- | :--- |
92
+ | `--repo` | `-r` | تحديد مسار مستودع Git (الافتراضي: المجلد الحالي). |
93
+ | `--language` | `-l` | اختيار لغة الواجهة (`ar` أو `en`). الافتراضي هو `ar`. |
94
+ | `--version` | `-v` | عرض رقم إصدار الأداة. |
95
+ | `--help` | `-h` | عرض رسالة المساعدة. |
96
+
97
+ **مثال:** تشغيل الأداة على مستودع محدد باللغة الإنجليزية.
98
+ ```sh
99
+ python -m githydra --repo /path/to/project --language en
100
+ ```
101
+
102
+ ---
103
+
104
+ ## 📂 هيكلية المشروع
105
+
106
+ تم تصميم `GitHydra` بهيكلية معيارية (Modular) لضمان سهولة الصيانة والتطوير المستقبلي.
107
+
108
+ ```plaintext
109
+ githydra/
110
+ ├── __main__.py # نقطة الدخول التنفيذية للتطبيق
111
+ ├── analytics/ # وحدات تحليل المستودع (إحصائيات، سجلات)
112
+ ├── core/ # المنطق الأساسي (المستودع، الإعدادات، الجلسات)
113
+ ├── help/ # وحدات المساعدة والدروس التعليمية
114
+ ├── localization/ # ملفات الترجمة ودعم اللغات
115
+ ├── operations/ # منطق عمليات Git (commit, branch, merge)
116
+ ├── ui/ # مكونات واجهة المستخدم (العرض، القوائم، التقدم)
117
+ └── utils/ # أدوات مساعدة (تسجيل، مدققات، دوال عامة)
118
+ ```
119
+
120
+ ---
121
+
122
+ ## 🤝 المساهمة
123
+
124
+ المساهمات هي ما يجعل مجتمع المصادر المفتوحة مكانًا رائعًا للتعلم والإلهام والإبداع. نرحب بأي مساهمات في مشروع `GitHydra`.
125
+
126
+ 1. **قم بعمل Fork** للمشروع.
127
+ 2. **أنشئ فرعًا جديدًا** لميزتك (`git checkout -b feature/NewFeature`).
128
+ 3. **قم بعمل Commit** لتغييراتك (`git commit -m 'feat: Add some NewFeature'`).
129
+ 4. **ارفع تغييراتك** إلى الفرع (`git push origin feature/NewFeature`).
130
+ 5. **افتح طلب سحب (Pull Request)**.
131
+
132
+ ---
133
+
134
+ ## 📄 الترخيص
135
+
136
+ موزع بموجب ترخيص MIT. انظر `LICENSE` لمزيد من المعلومات.
137
+
138
+ <div align="center">
139
+
140
+ **تم التطوير بواسطة عبدالعزيز القديمي**
141
+
142
+ </div>
@@ -0,0 +1,17 @@
1
+ """
2
+ GitHydra - Advanced Git Repository Management Tool
3
+ Author: Abdulaziz Alqudimi
4
+ Version: 1.0.0
5
+
6
+ A powerful, professional Git management tool with beautiful UI,
7
+ comprehensive logging, and intelligent automation.
8
+ """
9
+
10
+ __version__ = "1.0.0"
11
+ __author__ = "Abdulaziz Alqudimi"
12
+ __description__ = "Advanced Git Repository Management Tool"
13
+
14
+ from githydra.core.repository import RepositoryManager
15
+ from githydra.ui.display import DisplayManager
16
+
17
+ __all__ = ["RepositoryManager", "DisplayManager"]
@@ -0,0 +1,289 @@
1
+ """
2
+ GitHydra - Advanced Git Repository Manager
3
+ Author: Abdulaziz Alqudimi
4
+ Version: 1.0.0
5
+
6
+ Main entry point for the application.
7
+ """
8
+
9
+ import sys
10
+ import argparse
11
+ from pathlib import Path
12
+
13
+ from githydra.core.repository import RepositoryManager
14
+ from githydra.core.config import ConfigurationManager
15
+ from githydra.core.session import SessionManager
16
+ from githydra.ui.display import DisplayManager
17
+ from githydra.ui.menu import MenuSystem
18
+ from githydra.ui.progress import ProgressBarManager
19
+ from githydra.utils.logger import LoggingSystem
20
+ from githydra.localization.ar import ARABIC_TRANSLATIONS
21
+ from githydra.localization.en import ENGLISH_TRANSLATIONS
22
+ from githydra.operations.commit import CommitController
23
+ from githydra.operations.branch import BranchController
24
+ from githydra.operations.remote import RemoteController
25
+ from githydra.analytics.stats import StatisticsAnalyzer
26
+ from githydra.help.guides import HelpGuides
27
+
28
+
29
+ class GitHydra:
30
+ """
31
+ Main application class for GitHydra.
32
+
33
+ Args:
34
+ repo_path (str): Path to Git repository
35
+ language (str): Interface language ('ar' or 'en')
36
+
37
+ Returns:
38
+ GitHydra: Application instance
39
+ """
40
+
41
+ def __init__(self, repo_path: str = ".", language: str = "ar"):
42
+ self.logger = LoggingSystem()
43
+ self.config = ConfigurationManager()
44
+ self.session = SessionManager()
45
+ self.display = DisplayManager()
46
+
47
+ self.language = language or self.config.get("language", "ar")
48
+ self.translations = ARABIC_TRANSLATIONS if self.language == "ar" else ENGLISH_TRANSLATIONS
49
+
50
+ self.repo_manager = RepositoryManager(repo_path, self.config, self.session)
51
+ self.menu = MenuSystem(self.display, self.translate)
52
+ self.progress = ProgressBarManager(self.display.console)
53
+
54
+ self.commit_controller = CommitController(self.repo_manager.repo)
55
+ self.branch_controller = BranchController(self.repo_manager.repo)
56
+ self.remote_controller = RemoteController(self.repo_manager.repo)
57
+ self.stats_analyzer = StatisticsAnalyzer(self.repo_manager.repo)
58
+ self.help_guides = HelpGuides(self.translate)
59
+
60
+ self.logger.info("GitHydra application initialized")
61
+
62
+ def translate(self, key: str, *args) -> str:
63
+ """
64
+ Translate text to current language.
65
+
66
+ Args:
67
+ key (str): Translation key
68
+ *args: Format arguments
69
+
70
+ Returns:
71
+ str: Translated text
72
+ """
73
+ text = self.translations.get(key, key)
74
+ if args:
75
+ try:
76
+ return text.format(*args)
77
+ except:
78
+ return text
79
+ return text
80
+
81
+ def run(self) -> None:
82
+ """
83
+ Run the main application loop.
84
+
85
+ Args:
86
+ None
87
+
88
+ Returns:
89
+ None
90
+ """
91
+ self.display.print_banner()
92
+ self.logger.info("Application started")
93
+
94
+ while True:
95
+ try:
96
+ status = self.repo_manager.get_status()
97
+ branch = self.repo_manager.get_current_branch()
98
+ changes = len(status['staged']) + len(status['modified']) + len(status['untracked'])
99
+ sync_status = "[synced]"
100
+
101
+ choice = self.menu.show_main_menu(branch, changes, sync_status)
102
+
103
+ if choice == "0":
104
+ self.display.print_success(self.translate('goodbye'))
105
+ self.session.save_session()
106
+ break
107
+ elif choice == "1":
108
+ self.show_status()
109
+ elif choice == "2":
110
+ self.smart_add()
111
+ elif choice == "3":
112
+ self.commit()
113
+ elif choice == "4":
114
+ self.push()
115
+ elif choice == "5":
116
+ self.pull()
117
+ elif choice == "6":
118
+ self.show_log()
119
+ elif choice == "7":
120
+ self.manage_branches()
121
+ elif choice == "8":
122
+ self.show_repo_info()
123
+ elif choice == "18":
124
+ self.show_help()
125
+ else:
126
+ self.display.print_info("Feature coming soon!")
127
+
128
+ input(self.translate('press_enter'))
129
+
130
+ except KeyboardInterrupt:
131
+ self.display.print_warning(self.translate('operation_cancelled'))
132
+ break
133
+ except Exception as e:
134
+ self.display.print_error(self.translate('unexpected_error', str(e)))
135
+ self.logger.error(f"Application error: {e}", exc_info=True)
136
+ input(self.translate('press_enter'))
137
+
138
+ def show_status(self) -> None:
139
+ """Show repository status."""
140
+ status = self.repo_manager.get_status()
141
+
142
+ self.display.print_header("Repository Status", "📊")
143
+ self.display.print_info(f"Branch: {status['branch']}")
144
+
145
+ if status['staged']:
146
+ self.display.print_success(f"Staged files: {len(status['staged'])}")
147
+ for file in status['staged'][:5]:
148
+ self.display.console.print(f" ✅ {file}")
149
+
150
+ if status['modified']:
151
+ self.display.print_warning(f"Modified files: {len(status['modified'])}")
152
+ for file in status['modified'][:5]:
153
+ self.display.console.print(f" 📝 {file}")
154
+
155
+ if status['untracked']:
156
+ self.display.print_info(f"Untracked files: {len(status['untracked'])}")
157
+ for file in status['untracked'][:5]:
158
+ self.display.console.print(f" 🆕 {file}")
159
+
160
+ def smart_add(self) -> None:
161
+ """Smart add files."""
162
+ self.display.print_header(self.translate('smart_add_title'), "📦")
163
+ status = self.repo_manager.get_status()
164
+
165
+ all_files = status['modified'] + status['untracked']
166
+ if not all_files:
167
+ self.display.print_info(self.translate('no_changes'))
168
+ return
169
+
170
+ self.display.console.print(f"Found {len(all_files)} files:")
171
+ for i, file in enumerate(all_files, 1):
172
+ self.display.console.print(f" {i}. {file}")
173
+
174
+ choice = self.display.prompt("Add all files? (y/n)")
175
+ if choice.lower() == 'y':
176
+ try:
177
+ self.repo_manager.repo.git.add('.')
178
+ self.display.print_success("All files added to staging")
179
+ self.logger.log_operation("add", "success", "all files")
180
+ except Exception as e:
181
+ self.display.print_error(f"Failed to add files: {e}")
182
+ self.logger.log_operation("add", "failed", str(e))
183
+
184
+ def commit(self) -> None:
185
+ """Commit changes."""
186
+ self.display.print_header(self.translate('commit_title'), "💾")
187
+
188
+ status = self.repo_manager.get_status()
189
+ if not status['staged'] and not status['modified']:
190
+ self.display.print_info(self.translate('no_changes'))
191
+ return
192
+
193
+ message = self.display.prompt("Enter commit message")
194
+ if message:
195
+ if self.commit_controller.commit(message):
196
+ self.display.print_success(self.translate('commit_success', message[:50]))
197
+ else:
198
+ self.display.print_error("Failed to commit")
199
+
200
+ def push(self) -> None:
201
+ """Push changes."""
202
+ try:
203
+ self.repo_manager.repo.git.push()
204
+ self.display.print_success(self.translate('push_success'))
205
+ self.logger.log_operation("push", "success", "")
206
+ except Exception as e:
207
+ self.display.print_error(f"Push failed: {e}")
208
+ self.logger.log_operation("push", "failed", str(e))
209
+
210
+ def pull(self) -> None:
211
+ """Pull changes."""
212
+ try:
213
+ self.repo_manager.repo.git.pull()
214
+ self.display.print_success(self.translate('pull_success'))
215
+ self.logger.log_operation("pull", "success", "")
216
+ except Exception as e:
217
+ self.display.print_error(f"Pull failed: {e}")
218
+ self.logger.log_operation("pull", "failed", str(e))
219
+
220
+ def show_log(self) -> None:
221
+ """Show commit log."""
222
+ self.display.print_header("Commit History", "📜")
223
+ try:
224
+ commits = list(self.repo_manager.repo.iter_commits(max_count=10))
225
+ for commit in commits:
226
+ self.display.console.print(
227
+ f"[cyan]{commit.hexsha[:8]}[/] - "
228
+ f"[yellow]{commit.author.name}[/] - "
229
+ f"{commit.message.strip()}"
230
+ )
231
+ except Exception as e:
232
+ self.display.print_error(f"Failed to get log: {e}")
233
+
234
+ def manage_branches(self) -> None:
235
+ """Manage branches."""
236
+ self.display.print_header("Branch Management", "🌿")
237
+ branches = self.branch_controller.list_branches()
238
+ current = self.repo_manager.get_current_branch()
239
+
240
+ for branch in branches:
241
+ marker = "* " if branch == current else " "
242
+ self.display.console.print(f"{marker}[cyan]{branch}[/]")
243
+
244
+ def show_repo_info(self) -> None:
245
+ """Show repository info."""
246
+ self.display.print_header("Repository Information", "🏠")
247
+ stats = self.stats_analyzer.get_commit_stats()
248
+
249
+ self.display.console.print(f"Total commits: [cyan]{stats['total_commits']}[/]")
250
+ self.display.console.print(f"Contributors: [cyan]{stats['contributors']}[/]")
251
+
252
+ def show_help(self) -> None:
253
+ """Show help."""
254
+ help_text = self.help_guides.get_basic_help()
255
+ self.display.print_panel(help_text, title="📚 Help", border_style="green")
256
+
257
+
258
+ def main():
259
+ """
260
+ Main entry point.
261
+
262
+ Args:
263
+ None
264
+
265
+ Returns:
266
+ None
267
+ """
268
+ parser = argparse.ArgumentParser(
269
+ description='GitHydra - Advanced Git Repository Manager by Abdulaziz Alqudimi'
270
+ )
271
+ parser.add_argument('--repo', '-r', default='.', help='Repository path')
272
+ parser.add_argument('--language', '-l', choices=['ar', 'en'], default='ar',
273
+ help='Interface language')
274
+ parser.add_argument('--version', '-v', action='version', version='GitHydra 1.0.0')
275
+
276
+ args = parser.parse_args()
277
+
278
+ try:
279
+ app = GitHydra(repo_path=args.repo, language=args.language)
280
+ app.run()
281
+ except KeyboardInterrupt:
282
+ print("\n👋 Goodbye!")
283
+ except Exception as e:
284
+ print(f"❌ Fatal error: {e}")
285
+ sys.exit(1)
286
+
287
+
288
+ if __name__ == "__main__":
289
+ main()
@@ -0,0 +1,10 @@
1
+ """
2
+ Analytics modules for GitHydra
3
+ Provides statistics, code analysis, and history tracking
4
+ """
5
+
6
+ from githydra.analytics.stats import StatisticsAnalyzer
7
+ from githydra.analytics.code_analysis import CodeAnalyzer
8
+ from githydra.analytics.history import HistoryAnalyzer
9
+
10
+ __all__ = ["StatisticsAnalyzer", "CodeAnalyzer", "HistoryAnalyzer"]
@@ -0,0 +1,18 @@
1
+ """
2
+ Code analyzer for GitHydra
3
+ Author: Abdulaziz Alqudimi
4
+ """
5
+
6
+ from githydra.utils.logger import LoggingSystem
7
+
8
+
9
+ class CodeAnalyzer:
10
+ """Analyzes code quality."""
11
+
12
+ def __init__(self, repo):
13
+ self.repo = repo
14
+ self.logger = LoggingSystem()
15
+
16
+ def analyze(self) -> dict:
17
+ """Analyze code."""
18
+ return {'issues': [], 'suggestions': []}