Skip to content

Instantly share code, notes, and snippets.

View bitprophet's full-sized avatar
🎯
Focusing

Jeff Forcier bitprophet

🎯
Focusing
View GitHub Profile
## Normal/flat -- this is still the default output of fab --list:
Available commands:
build_docs
deploy
db.migrate
system.install_package
system.debian.update_apt
diff --git a/fabric/main.py b/fabric/main.py
index 33f2f47..89a1cec 100644
--- a/fabric/main.py
+++ b/fabric/main.py
@@ -167,7 +167,7 @@ def is_task_module(a):
Determine if the provided value is a task module
"""
return (type(a) is types.ModuleType and
- getattr(a, "FABRIC_TASK_MODULE", False))
+ any(map(is_task_object, vars(a).values())))
diff --git a/fabric/main.py b/fabric/main.py
index 33f2f47..89a1cec 100644
--- a/fabric/main.py
+++ b/fabric/main.py
@@ -167,7 +167,7 @@ def is_task_module(a):
Determine if the provided value is a task module
"""
return (type(a) is types.ModuleType and
- getattr(a, "FABRIC_TASK_MODULE", False))
+ any(map(is_task_object, vars(a).values())))
#!/usr/bin/env python
# Copyright (c) 2008 Nick Jensen
# MIT License
import xml.dom.minidom
import urllib, sys, datetime
PHONE_STRIPS = ('-', ' ', ')', '(')
@bitprophet
bitprophet / system.py
Created January 7, 2011 18:18
Fabric subroutine for prepping debconf
def debconf(package, key, value, type_='string', key_prefix=None):
"""
Seeds the debconf database with given values.
Take the following example::
debconf(
package='mysql-server',
key='root_password',
type_='password',
adsf (1.0.1)
bluecloth (2.0.7)
bundler (0.9.25)
compass (0.10.1)
cri (1.0.1)
diff-lcs (1.1.2)
grit (2.0.0)
haml (3.0.6)
mime-types (1.16)
nanoc (3.1.3)
16:12 < idangazit> termie: I had some ruminations on the gunicorn vs. django pony this morning.
16:13 < termie> if the gunicorn and the django pony had sex the django pony would explode as if a small but powerful explosive had been set off inside it
16:14 < termie> but then the django pony would reconstitute itself through the power of love
16:15 < robhudson> drawing on the magic once removed from Django?
#
# Initial, naive version
#
from fabric.api import *
def _new_rpms():
"""
@bitprophet
bitprophet / gist:274410
Created January 11, 2010 17:36
Designed for use with non-system gem location e.g. homebrew or ~/.gems
#
# Try to make up for Ruby's lack of easy setup.py develop sorta thing.
#
function fakegem() {
if [[ `env | grep GEM_HOME` ]]; then
projects=~/Documents/Code
for project in `ls -1 $projects`; do
bin=$projects/$project/bin
lib=$projects/$project/lib
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.files import *
import system
def xen():
"""