Tag: python

Get the current value of env.hosts list with Python Fabric Library

I’ve got this code (foo and bar are local servers): env.hosts = [‘foo’, ‘bar’] def mytask(): print(env.hosts[0]) Which, of course prints foo every iteration. As you probably know, Fabric iterates through the env.hosts list and executes mytask() on each of them this way: fab mytask does task is executed on foo task is executed on […]

How to python version control?Do I need setuptools if I use git?

Python has it own distutils which I have limited knowledge with. What I know is: it use MANIFEST.in to do file ignorance/inclusion. it is doing so python setup.py sdist then i will have a gzipped dist And I found there is a https://pypi.python.org/pypi/setuptools–git that use git, but I don’t see how it related to git, […]

How to setup django application for production and open source, with one repository

I have a python/django project that I’ve set up for development and production using git revision control. I have three settings.py files: -settings.py (which has dummy variables for potential open source project), -settings_production.py (for production variables), and -settings_local.py (to override settings just for my local environment). This file is not tracked by git. I use […]

How to setup buildbot for

I am quite new to buildbot and struggling to create a configuration for the following python code structure: A library containing some general classes and functions and two programs who depend on the one library. All three have their own git repository. Lets call the library the_lib and the programs prog_a and prog_b. What I […]

PyGit2 – TreeBuilder.insert('name',blobid,GIT_FILEMODE_BLOB) vs index.add( 'path/to/file' )?

I’m a little confused about how to get started with PyGit2. When adding files (plural) to a newly created repo, should I add them to index.add(‘path/to/file’) or would I be better off creating a TreeBuilder and using tb.insert( ‘name’,oid, GIT_FILEMODE_BLOB ) to add new content ? If the second case, I am stumped as to […]

Python: Printing to standard out when running from a Gitolite trigger(hook)

So on my Gitolite server I have a python script set to run from the trigger GIT_POST. All I want it to do is print some information to the client. This is the script: #!/usr/bin/env python import sys import fileinput def main(): print “Trying to read input” for line in sys.argv: print line sys.exit(0) if […]

opening git diff in sublime using python for custom command

The core.editor of my git is sublime, but I am launching sublime in my custom git command made in python, so how can i pass git diff HEAD^ HEAD to sublime as argument in python I have stored the value of core.editor in configdb[‘core.editor’] which i can launch using subprocess.Popen but passing git diff HEAD^ […]

Simplifying development process for Django

I’m a freelance editor and tutor as well as a fiction writer and artist looking to transition to the latter on a full-time basis. Naturally, part of that transition involves constructing a website; a dynamic site to which new content in various forms can be added with ease. Now, I’ve always intended to learn how […]

how to add colour diff in git send-email

I am using git send-email command, but the diff patch is not colored. If I try git send-email -1 –color it send ANSI colour code in email and unformatted text. I want to be able to mail color diff patch.

how to confirm that current git diff is one with current and last and not with current commit and any other

I am making a tool in python to push and obviously I would want to push the last commit so if I am checking the diff of the last I want to push but if the diff is not of current and last HEAD, then git push should not work. How to check if the […]

Git Baby is a git and github fan, let's start git clone.