Permalink
Browse files

code cleanup

  • Loading branch information...
Harley Bussell
Harley Bussell committed Jan 28, 2010
1 parent fe00125 commit 94ae8621db33c37ad092f6a4b712459b3e9f6d28
Showing with 16 additions and 10 deletions.
  1. +1 −1 djangofab/api.py
  2. +1 −5 djangofab/decorator.py
  3. +2 −1 djangofab/django.py
  4. +3 −3 djangofab/util.py
  5. +9 −0 djangofab/vcs/git.py
View
@@ -1,7 +1,7 @@
from fabric.api import *
from fabric.context_managers import *
from fabric.operations import _handle_failure
-from djangofab.vcs.git import update_remote, update_local, push, commit, add
+#from djangofab.vcs.git import update_remote, update_local, push, commit, add
from djangofab.decorator import user_settings
from djangofab.util import local as local, apply_settings
from djangofab.django import get_remote_db, put_local_db, change_ownership, touch_wsgi
View
@@ -1,11 +1,7 @@
-import os
-import sys
-import ConfigParser
-import subprocess
-from djangofab.util import apply_settings
def user_settings(file='fab.cfg', group='default'):
"Decorator to load user settings from a config file into the env"
+ from djangofab.util import apply_settings
def wrap(f=None):
def wrapped_f(*args):
f(*args)
View
@@ -61,7 +61,8 @@ def change_ownership():
def touch_wsgi():
"Touch the wsgi file to trigger wsgi to reload the processes."
with cd(env.path):
- run("touch bin/django.wsgi")
+ #run("touch bin/django.wsgi")
+ run("touch %s" % env.wsgi)
def syncdb():
"Sync database and run"
View
@@ -1,8 +1,8 @@
import os
-import sys
import ConfigParser
-import subprocess
-from djangofab.api import *
+#from djangofab.api import *
+from fabric.api import *
+from fabric.operations import local as _local
def local(cmd):
if hasattr(env,'capture_default'):
View
@@ -1,12 +1,21 @@
from __future__ import with_statement
from djangofab.api import *
+import os
def update_remote():
"Update remote checkout to the latest version"
with cd(env.path):
run('git reset --hard')
run('git pull')
+def update_app():
+ "Update remote checkout to the latest version"
+ app = prompt('app name?')
+ #with cd(os.path.join(os.path.dirname(env.path),'src',app)):
+ with cd(os.path.join(env.virtualenv,'src',app)):
+ run('git reset --hard')
+ run('git pull origin master')
+
def push():
"Pull changes from version control"
local('git push')

0 comments on commit 94ae862

Please sign in to comment.