Skip to main content

"Socle de fonctions utilisées dans les scripts python de gestion d'infrastructure."

Project description

Build Status License Language

Scrippy, my Scrangourou friend

scrippy_git

Git client for the Scrippy framework.

Prerequisites

Python Modules

List of Required Modules

The modules listed below will be automatically installed.

  • GitPython

Installation

Manual

git clone https://codeberg.org/scrippy/scrippy-git.git
cd scrippy-git
python -m pip install -r requirements.txt
make install

With pip

pip install scrippy-git

Usage

The scrippy_git.git module provides the Repo object for easy manipulation of a Git repository.

import os
from scrippy_git import git

username = "git"
host = "gitlab.monty.py"
port = 2242
reponame = "luiggi.vercotti/monty_python.git"
branch = "master"

repo = git.Repo(username, host, port, reponame)
local_path = os.path.join(workspace_path, "monty_python")
repo.clone(branch=branch, path=local_path)

test_fname = os.path.join(local_path, "dead_parrot.txt")
with open(test_fname, mode="w") as test_file:
  test_file.write("Nobody expects the Spanish inquisition !")
  commit_message = "Inquisition shall not be expected"
  repo.commit_push(commit_message)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrippy-git-1.1.75.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

scrippy_git-1.1.75-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page