gitcloak/test.py
Kumi 117997a5d9
feat: add initial project setup with Flask and Git integration
Introduce the initial project structure for gitcloak, a Python-based private frontend for GitHub repositories. Key changes include:

- Added .gitignore to exclude virtual environment, bytecode files, and cache directories.
- Added LICENSE file using the MIT License.
- Created a basic `pyproject.toml` with project metadata and dependencies.
- Implemented Flask-based application to render repository structure and file contents.
- Added `Git` class to handle interactions with remote GitHub repositories using Dulwich and requests.
- Included HTML template for displaying repo content.
- Created sample `test.py` for testing Git class methods.

This setup enables foundational project functionality and establishes a clear structure for further development.
2024-06-18 17:00:05 +02:00

11 lines
363 B
Python

from gitcloak.classes.git import Git
repo = "https://github.com/privatecoffee/transfer.coffee"
git = Git(repo)
print(git.get_directory_structure())
file_path = "public/dist/js/webtorrent.LICENSE"
content = git.get_file_content(file_path)
print(f"Type of content: {type(content)}")
content = content.decode('utf-8')
print(f"\nContent of {file_path}:\n{content}")